diff options
author | Samuel Cabrero <scabrero@suse.de> | 2020-12-15 17:46:56 +0100 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2020-12-15 15:13:47 -0600 |
commit | 09a8361e3b681ef6b56cc56f7b2905b4455d6774 (patch) | |
tree | 3e74c1404183a0b5cf69c59bce8daad477224ee3 /fs/cifs/cifsfs.c | |
parent | dd538034f84fa4ea670420aac19adcceef45d057 (diff) |
cifs: Fix some error pointers handling detected by static checker
* extract_hostname() and extract_sharename() never return NULL, so
use IS_ERR() instead of IS_ERR_OR_NULL() in cifs_find_swn_reg(). If
any of these functions return an error, then return an error pointer
instead of NULL.
* Change cifs_find_swn_reg() function to always return a valid pointer
or an error pointer, instead of returning NULL if the registration
is not found.
* Finally update cifs_find_swn_reg() callers to check for -EEXIST
instead of NULL.
* In cifs_get_swn_reg() the swnreg idr mutex was not unlocked in the
error path of cifs_find_swn_reg() call.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/cifsfs.c')
0 files changed, 0 insertions, 0 deletions