From: Logan Gunthorpe <logang@deltatee.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Kurt Schwemmer <kurt.schwemmer@microsemi.com>
Cc: Stephen Bates <stephen.bates@microsemi.com>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] switchtec: checking for NULL instead of IS_ERR()
Date: Wed, 12 Apr 2017 10:47:27 -0600 [thread overview]
Message-ID: <3de7a06b-d27c-9775-8eb9-1b02bf8e2fec@deltatee.com> (raw)
In-Reply-To: <20170412083525.GF3250@mwanda>
Hi Dan,
Thanks for the fix. This is the exact same patch Christophe Jaillet sent
a couple of days ago so only one needs to be merged.
Logan
On 12/04/17 02:35 AM, Dan Carpenter wrote:
> stuser_create() uses error pointers, it never returns NULL.
>
> Fixes: 74004262f329 ("MicroSemi Switchtec management interface driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
> index fcde98161d9a..cc6e085008fb 100644
> --- a/drivers/pci/switch/switchtec.c
> +++ b/drivers/pci/switch/switchtec.c
> @@ -608,7 +608,7 @@ static int switchtec_dev_open(struct inode *inode, struct file *filp)
> stdev = container_of(inode->i_cdev, struct switchtec_dev, cdev);
>
> stuser = stuser_create(stdev);
> - if (!stuser)
> + if (IS_ERR(stuser))
> return PTR_ERR(stuser);
>
> filp->private_data = stuser;
>
prev parent reply other threads:[~2017-04-12 16:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-12 8:35 [PATCH] switchtec: checking for NULL instead of IS_ERR() Dan Carpenter
2017-04-12 16:47 ` Logan Gunthorpe [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=3de7a06b-d27c-9775-8eb9-1b02bf8e2fec@deltatee.com \
--to=logang@deltatee.com \
--cc=bhelgaas@google.com \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kurt.schwemmer@microsemi.com \
--cc=linux-pci@vger.kernel.org \
--cc=stephen.bates@microsemi.com \
/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).