]> git.baikalelectronics.ru Git - kernel.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)
committerSteve French <stfrench@microsoft.com>
Thu, 2 Jul 2020 01:01:26 +0000 (20:01 -0500)
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>
fs/cifs/transport.c

index d11e31064679b12a6e315679cc2ff8210cf4b569..84433d0653f92a896eba0a063eecdec1b3321b6d 100644 (file)
@@ -523,7 +523,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;