lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Wed, 10 Oct 2018 02:00:24 +0000 From: Wei Yongjun <weiyongjun1@...wei.com> To: Kishon Vijay Abraham I <kishon@...com>, "David S. Miller" <davem@...emloft.net>, Quentin Schulz <quentin.schulz@...tlin.com> CC: Wei Yongjun <weiyongjun1@...wei.com>, <linux-kernel@...r.kernel.org>, <kernel-janitors@...r.kernel.org>, <netdev@...r.kernel.org> Subject: [PATCH -next] phy: phy-ocelot-serdes: fix return value check in serdes_probe() In case of error, the function syscon_node_to_regmap() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 51f6b410fc22 ("phy: add driver for Microsemi Ocelot SerDes muxing") Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com> --- drivers/phy/mscc/phy-ocelot-serdes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/mscc/phy-ocelot-serdes.c b/drivers/phy/mscc/phy-ocelot-serdes.c index 8936abd..b2be546 100644 --- a/drivers/phy/mscc/phy-ocelot-serdes.c +++ b/drivers/phy/mscc/phy-ocelot-serdes.c @@ -257,8 +257,8 @@ static int serdes_probe(struct platform_device *pdev) ctrl->dev = &pdev->dev; ctrl->regs = syscon_node_to_regmap(pdev->dev.parent->of_node); - if (!ctrl->regs) - return -ENODEV; + if (IS_ERR(ctrl->regs)) + return PTR_ERR(ctrl->regs); for (i = 0; i <= SERDES_MAX; i++) { ret = serdes_phy_create(ctrl, i, &ctrl->phys[i]);
Powered by blists - more mailing lists