linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] can: c_can: checking IS_ERR() instead of NULL
@ 2014-08-01  8:53 Dan Carpenter
  2014-08-01  9:01 ` Marc Kleine-Budde
  2014-08-01 18:16 ` Wolfram Sang
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Carpenter @ 2014-08-01  8:53 UTC (permalink / raw)
  To: Wolfgang Grandegger, George Cherian
  Cc: Marc Kleine-Budde, Grant Likely, Rob Herring, Thor Thayer,
	Pavel Machek, Mugunthan V N, Lad, Prabhakar, Wolfram Sang,
	linux-can, kernel-janitors

devm_ioremap() returns NULL on error, not an ERR_PTR().

Fixes: 33cf75656923 ('can: c_can_platform: Fix raminit, use devm_ioremap() instead of devm_ioremap_resource()')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This will need to go to -stable because the patch which introduces the
bug is going to be pushed to -stable.

diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
index 5dede6e..109cb44 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -280,7 +280,7 @@ static int c_can_plat_probe(struct platform_device *pdev)
 
 		priv->raminit_ctrlreg = devm_ioremap(&pdev->dev, res->start,
 						     resource_size(res));
-		if (IS_ERR(priv->raminit_ctrlreg) || priv->instance < 0)
+		if (!priv->raminit_ctrlreg || priv->instance < 0)
 			dev_info(&pdev->dev, "control memory is not used for raminit\n");
 		else
 			priv->raminit = c_can_hw_raminit_ti;

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

end of thread, other threads:[~2014-08-01 18:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-01  8:53 [patch] can: c_can: checking IS_ERR() instead of NULL Dan Carpenter
2014-08-01  9:01 ` Marc Kleine-Budde
2014-08-01  9:13   ` Dan Carpenter
2014-08-01  9:15     ` Marc Kleine-Budde
2014-08-01 18:16 ` Wolfram Sang

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