smb3: missing null check in SMB2_change_notify

[ Upstream commit b535cc796a ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Steve French 2023-05-25 18:53:28 -05:00 committed by Greg Kroah-Hartman
parent 3e8458c5b2
commit 9d8ac2726c
1 changed files with 1 additions and 1 deletions

View File

@ -3779,7 +3779,7 @@ SMB2_change_notify(const unsigned int xid, struct cifs_tcon *tcon,
if (*out_data == NULL) {
rc = -ENOMEM;
goto cnotify_exit;
} else
} else if (plen)
*plen = le32_to_cpu(smb_rsp->OutputBufferLength);
}