linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] can: flexcan: fix 'passing zero to ERR_PTR()' warning
@ 2018-12-12  9:24 YueHaibing
  2019-01-04 15:21 ` Marc Kleine-Budde
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2018-12-12  9:24 UTC (permalink / raw)
  To: davem, wg, mkl; +Cc: linux-kernel, netdev, linux-can, YueHaibing

Fix a static code checker warning:
drivers/net/can/flexcan.c:1435 flexcan_setup_stop_mode() warn: passing zero to 'PTR_ERR'

Fixes: de3578c198c6 ("can: flexcan: add self wakeup support")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/can/flexcan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 0f36eaf..5f09764 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -1432,7 +1432,7 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev)
 	gpr_np = of_find_node_by_phandle(phandle);
 	if (!gpr_np) {
 		dev_dbg(&pdev->dev, "could not find gpr node by phandle\n");
-		return PTR_ERR(gpr_np);
+		return -ENODEV;
 	}
 
 	priv = netdev_priv(dev);
-- 
2.7.0



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

* Re: [PATCH net-next] can: flexcan: fix 'passing zero to ERR_PTR()' warning
  2018-12-12  9:24 [PATCH net-next] can: flexcan: fix 'passing zero to ERR_PTR()' warning YueHaibing
@ 2019-01-04 15:21 ` Marc Kleine-Budde
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2019-01-04 15:21 UTC (permalink / raw)
  To: YueHaibing, davem, wg; +Cc: linux-kernel, netdev, linux-can


[-- Attachment #1.1: Type: text/plain, Size: 609 bytes --]

On 12/12/18 10:24 AM, YueHaibing wrote:
> Fix a static code checker warning:
> drivers/net/can/flexcan.c:1435 flexcan_setup_stop_mode() warn: passing zero to 'PTR_ERR'
> 
> Fixes: de3578c198c6 ("can: flexcan: add self wakeup support")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Applied to linux-can.

tnx,
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: 488 bytes --]

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

end of thread, other threads:[~2019-01-04 15:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-12  9:24 [PATCH net-next] can: flexcan: fix 'passing zero to ERR_PTR()' warning YueHaibing
2019-01-04 15:21 ` 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).