Re: [PATCH] cifs: Fix some error pointers handling detected by static checker

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 15, 2020 at 05:46:56PM +0100, Samuel Cabrero wrote:
> * 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@xxxxxxxxxx>
> Signed-off-by: Samuel Cabrero <scabrero@xxxxxxx>

Fantastic!

Reviewed-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

regards,
dan carpenter




[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux