OSDN Git Service

phy: rockchip-dp: fix return value check in rockchip_dp_phy_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 13 Jun 2016 23:31:47 +0000 (23:31 +0000)
committerKishon Vijay Abraham I <kishon@ti.com>
Fri, 17 Jun 2016 13:14:24 +0000 (18:44 +0530)
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>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/phy-rockchip-dp.c

index 793ecb6..8b267a7 100644 (file)
@@ -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;