]> git.baikalelectronics.ru Git - kernel.git/commit
smb2: small refactor in smb2_check_message()
authorEnzo Matsumiya <ematsumiya@suse.de>
Tue, 19 Jul 2022 17:31:51 +0000 (14:31 -0300)
committerSteve French <stfrench@microsoft.com>
Mon, 1 Aug 2022 06:34:44 +0000 (01:34 -0500)
commitace3b869f4daeb77c8825590c1003c764d8a59e6
tree1f330027713bdc0c4c397bcf9740bd17220da702
parent06b1106df3ea79aa5f7de0323226ca1d3d7e476f
smb2: small refactor in smb2_check_message()

If the command is SMB2_IOCTL, OutputLength and OutputContext are
optional and can be zero, so return early and skip calculated length
check.

Move the mismatched length message to the end of the check, to avoid
unnecessary logs when the check was not a real miscalculation.

Also change the pr_warn_once() to a pr_warn() so we're sure to get a
log for the real mismatches.

Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/connect.c
fs/cifs/smb2misc.c