提交 1cbdfc48 编写于 作者: A Axel Lin 提交者: Kishon Vijay Abraham I

phy: hix5hd2-sata: Check return value of platform_get_resource

This prevent NULL pointer dereference if res is NULL.
Signed-off-by: NAxel Lin <axel.lin@ingics.com>
Acked-by: NZhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: NKishon Vijay Abraham I <kishon@ti.com>
上级 0f9722e3
......@@ -147,6 +147,9 @@ static int hix5hd2_sata_phy_probe(struct platform_device *pdev)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -EINVAL;
priv->base = devm_ioremap(dev, res->start, resource_size(res));
if (!priv->base)
return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册