Skip to content

Commit 0266a2f

Browse files
Wang Mingsmfrench
authored andcommitted
ksmbd: Fix unsigned expression compared with zero
The return value of the ksmbd_vfs_getcasexattr() is signed. However, the return value is being assigned to an unsigned variable and subsequently recasted, causing warnings. Use a signed type. Signed-off-by: Wang Ming <[email protected]> Acked-by: Tom Talpey <[email protected]> Acked-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 06c2afb commit 0266a2f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fs/smb/server/vfs.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,8 @@ static int ksmbd_vfs_stream_write(struct ksmbd_file *fp, char *buf, loff_t *pos,
412412
{
413413
char *stream_buf = NULL, *wbuf;
414414
struct mnt_idmap *idmap = file_mnt_idmap(fp->filp);
415-
size_t size, v_len;
415+
size_t size;
416+
ssize_t v_len;
416417
int err = 0;
417418

418419
ksmbd_debug(VFS, "write stream data pos : %llu, count : %zd\n",
@@ -429,9 +430,9 @@ static int ksmbd_vfs_stream_write(struct ksmbd_file *fp, char *buf, loff_t *pos,
429430
fp->stream.name,
430431
fp->stream.size,
431432
&stream_buf);
432-
if ((int)v_len < 0) {
433+
if (v_len < 0) {
433434
pr_err("not found stream in xattr : %zd\n", v_len);
434-
err = (int)v_len;
435+
err = v_len;
435436
goto out;
436437
}
437438

0 commit comments

Comments
 (0)