From: Dan Carpenter <dan.carpenter@oracle.com>
To: Samuel Cabrero <scabrero@suse.de>
Cc: linux-cifs@vger.kernel.org
Subject: Re: [PATCH] cifs: Fix some error pointers handling detected by static checker
Date: Tue, 15 Dec 2020 20:54:33 +0300 [thread overview]
Message-ID: <20201215175433.GD2831@kadam> (raw)
In-Reply-To: <20201215164656.28788-1-scabrero@suse.de>
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@oracle.com>
> Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Fantastic!
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
regards,
dan carpenter
prev parent reply other threads:[~2020-12-15 17:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-15 16:46 [PATCH] cifs: Fix some error pointers handling detected by static checker Samuel Cabrero
2020-12-15 17:54 ` Dan Carpenter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201215175433.GD2831@kadam \
--to=dan.carpenter@oracle.com \
--cc=linux-cifs@vger.kernel.org \
--cc=scabrero@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).