]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
cifs: Fix TCP_Server_Info::credits to be signed
authorDavid Howells <dhowells@redhat.com>
Mon, 20 Oct 2025 08:40:02 +0000 (09:40 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2025 13:08:56 +0000 (14:08 +0100)
commit 5b2ff4873aeab972f919d5aea11c51393322bf58 upstream.

Fix TCP_Server_Info::credits to be signed, just as echo_credits and
oplock_credits are.  This also fixes what ought to get at least a
compilation warning if not an outright error in *get_credits_field() as a
pointer to the unsigned server->credits field is passed back as a pointer
to a signed int.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-cifs@vger.kernel.org
Cc: stable@vger.kernel.org
Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Acked-by: Pavel Shilovskiy <pshilovskiy@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/client/cifsglob.h

index b74637ae9085a58e4ebff883409f0e78de893cb2..6a35e884b41fc4b576fdaa784aafdd0a3b43e81f 100644 (file)
@@ -703,7 +703,7 @@ struct TCP_Server_Info {
        bool nosharesock;
        bool tcp_nodelay;
        bool terminate;
-       unsigned int credits;  /* send no more requests at once */
+       int credits;  /* send no more requests at once */
        unsigned int max_credits; /* can override large 32000 default at mnt */
        unsigned int in_flight;  /* number of requests on the wire to server */
        unsigned int max_in_flight; /* max number of requests that were on wire */