netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] can: c_can: Fix return value check in c_can_plat_probe()
@ 2014-08-14  0:58 weiyj_lk
  2014-08-14 10:11 ` Marc Kleine-Budde
  0 siblings, 1 reply; 2+ messages in thread
From: weiyj_lk @ 2014-08-14  0:58 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, Grant Likely,
	Rob Herring, Thomas Gleixner, Chen Gang, George Cherian,
	Sachin Kamat, Lad, Prabhakar, Pavel Machek, Thor Thayer,
	Mugunthan V N, Wolfram Sang
  Cc: Wei Yongjun, linux-can, netdev

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, the function devm_ioremap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should
be replaced with NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/net/can/c_can/c_can_platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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] 2+ messages in thread

* Re: [PATCH] can: c_can: Fix return value check in c_can_plat_probe()
  2014-08-14  0:58 [PATCH] can: c_can: Fix return value check in c_can_plat_probe() weiyj_lk
@ 2014-08-14 10:11 ` Marc Kleine-Budde
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2014-08-14 10:11 UTC (permalink / raw)
  To: weiyj_lk, Wolfgang Grandegger, Grant Likely, Rob Herring,
	Thomas Gleixner, Chen Gang, George Cherian, Sachin Kamat, Lad,
	Prabhakar, Pavel Machek, Thor Thayer, Mugunthan V N,
	Wolfram Sang
  Cc: Wei Yongjun, linux-can, netdev

[-- Attachment #1: Type: text/plain, Size: 741 bytes --]

On 08/14/2014 02:58 AM, weiyj_lk@163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> In case of error, the function devm_ioremap() returns NULL pointer
> not ERR_PTR(). The IS_ERR() test in the return value check should
> be replaced with NULL test.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Dan Carpenter already provided this fix. It will be included in my next
pull request to David's net.

Thanks,
Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

end of thread, other threads:[~2014-08-14 10:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-14  0:58 [PATCH] can: c_can: Fix return value check in c_can_plat_probe() weiyj_lk
2014-08-14 10:11 ` Marc Kleine-Budde

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