Skip to content

Commit b535cc7

Browse files
committed
smb3: missing null check in SMB2_change_notify
If plen is null when passed in, we only checked for null in one of the two places where it could be used. Although plen is always valid (not null) for current callers of the SMB2_change_notify function, this change makes it more consistent. Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Steve French <[email protected]>
1 parent 1dd5483 commit b535cc7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/smb/client/smb2pdu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3725,7 +3725,7 @@ SMB2_change_notify(const unsigned int xid, struct cifs_tcon *tcon,
37253725
if (*out_data == NULL) {
37263726
rc = -ENOMEM;
37273727
goto cnotify_exit;
3728-
} else
3728+
} else if (plen)
37293729
*plen = le32_to_cpu(smb_rsp->OutputBufferLength);
37303730
}
37313731

0 commit comments

Comments
 (0)