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 <lkp@intel.com> Reported-by: Dan Carpenter <error27@gmail.com> Closes: https://lore.kernel.org/all/202305251831.3V1gbbFs-lkp@intel.com/ Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 1dd5483 commit b535cc7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)