linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] switchtec: checking for NULL instead of IS_ERR()
@ 2017-04-12  8:35 Dan Carpenter
  2017-04-12 16:47 ` Logan Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-04-12  8:35 UTC (permalink / raw)
  To: Kurt Schwemmer, Logan Gunthorpe
  Cc: Stephen Bates, Bjorn Helgaas, linux-pci, kernel-janitors

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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-12 16:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-12  8:35 [PATCH] switchtec: checking for NULL instead of IS_ERR() Dan Carpenter
2017-04-12 16:47 ` Logan Gunthorpe

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).