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