]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cifs: Fix copy_to_iter return value check
authorFushuai Wang <wangfushuai@baidu.com>
Tue, 7 Oct 2025 08:26:03 +0000 (16:26 +0800)
committerSteve French <stfrench@microsoft.com>
Thu, 9 Oct 2025 15:42:14 +0000 (10:42 -0500)
commit0cc380d0e1d36b8f2703379890e90f896f68e9e8
treef35432952980732d782248580a822b1a9c883843
parent68d2e2ca1cba9259e943bcd188671b619b9770b4
cifs: Fix copy_to_iter return value check

The return value of copy_to_iter() function will never be negative,
it is the number of bytes copied, or zero if nothing was copied.
Update the check to treat 0 as an error, and return -1 in that case.

Fixes: d08089f649a0 ("cifs: Change the I/O paths to use an iterator rather than a page list")
Acked-by: Tom Talpey <tom@talpey.com>
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Fushuai Wang <wangfushuai@baidu.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smb2ops.c