Message ID | 1465860707-26005-1-git-send-email-weiyj_lk@163.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Am Montag, 13. Juni 2016, 23:31:47 schrieb weiyj_lk@163.com: > 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> obviously correct, thanks for catching. Reviewed-by: Heiko Stuebner <heiko@sntech.de>
On Tuesday 14 June 2016 12:09 PM, Heiko Stübner wrote: > Am Montag, 13. Juni 2016, 23:31:47 schrieb weiyj_lk@163.com: >> 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> > > obviously correct, thanks for catching. > > Reviewed-by: Heiko Stuebner <heiko@sntech.de> applied, thanks. -Kishon
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;