Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1421449

[PATCH] phy: rockchip-dp: fix return value check in rockchip_dp_phy_probe()

From weiyj_lk@163.com
Newsgroups linux.kernel
Subject [PATCH] phy: rockchip-dp: fix return value check in rockchip_dp_phy_probe()
Date 2016-06-14 01:40 +0200
Message-ID <rJJCx-4Wb-11@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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

In case of error, the function devm_kzalloc() 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/phy/phy-rockchip-dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/phy-rockchip-dp.c b/drivers/phy/phy-rockchip-dp.c
index 793ecb6..8b267a7 100644
--- a/drivers/phy/phy-rockchip-dp.c
+++ b/drivers/phy/phy-rockchip-dp.c
@@ -90,7 +90,7 @@ static int rockchip_dp_phy_probe(struct platform_device *pdev)
 		return -ENODEV;
 
 	dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL);
-	if (IS_ERR(dp))
+	if (!dp)
 		return -ENOMEM;
 
 	dp->dev = dev;

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] phy: rockchip-dp: fix return value check in rockchip_dp_phy_probe() weiyj_lk@163.com - 2016-06-14 01:40 +0200
  Re: [PATCH] phy: rockchip-dp: fix return value check in rockchip_dp_phy_probe() Heiko Stübner <heiko@sntech.de> - 2016-06-14 08:50 +0200
    Re: [PATCH] phy: rockchip-dp: fix return value check in  rockchip_dp_phy_probe() Kishon Vijay Abraham I <kishon@ti.com> - 2016-06-17 15:20 +0200

csiph-web