]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
cifs: prevent truncation from long to int in wait_for_free_credits
authorRonnie Sahlberg <lsahlber@redhat.com>
Thu, 2 Jul 2020 00:55:41 +0000 (10:55 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jul 2020 07:32:52 +0000 (09:32 +0200)
[ Upstream commit 19e888678bac8c82206eb915eaf72741b2a2615c ]

The wait_event_... defines evaluate to long so we should not assign it an int as this may truncate
the value.

Reported-by: Marshall Midden <marshallmidden@gmail.com>
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/cifs/transport.c

index fe1552cc8a0a74ab189707b0422c6e2d54e4e1fa..eafc49de4d7f7b9ad9c0e9895dd60d7cf85f488c 100644 (file)
@@ -528,7 +528,7 @@ wait_for_free_credits(struct TCP_Server_Info *server, const int num_credits,
                      const int timeout, const int flags,
                      unsigned int *instance)
 {
-       int rc;
+       long rc;
        int *credits;
        int optype;
        long int t;