cifs: return correct error in ->calc_signature()
authorEnzo Matsumiya <ematsumiya@suse.de>
Fri, 16 Sep 2022 23:57:05 +0000 (20:57 -0300)
committerSteve French <stfrench@microsoft.com>
Sun, 25 Sep 2022 22:01:50 +0000 (17:01 -0500)
commit09a1f9a168ae1f69f701689429871793174417d2
tree28bed485e4085f75631588ecd27bc8429fb8f9a4
parentd7752a6c60c2de889425e27912e3fa96ba5626b2
cifs: return correct error in ->calc_signature()

If an error happens while getting the key or session in the
->calc_signature implementations, 0 (success) is returned. Fix it by
returning a proper error code.

Since it seems to be highly unlikely to happen wrap the rc check in
unlikely() too.

Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Fixes: 32811d242ff6 ("cifs: Start using per session key for smb2/3 for signature generation")
Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2transport.c