projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0f9722e
)
phy: hix5hd2-sata: Check return value of platform_get_resource
author
Axel Lin
<axel.lin@ingics.com>
Mon, 2 Mar 2015 08:10:54 +0000
(16:10 +0800)
committer
Kishon Vijay Abraham I
<kishon@ti.com>
Thu, 12 Mar 2015 05:31:16 +0000
(11:01 +0530)
This prevent NULL pointer dereference if res is NULL.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/phy-hix5hd2-sata.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/phy/phy-hix5hd2-sata.c
b/drivers/phy/phy-hix5hd2-sata.c
index 34915b4202f18c5249a059dd42aa914fee2e7f2d..d6b22659cac11cfb4187cf9347ac86774f79de5e 100644
(file)
--- a/
drivers/phy/phy-hix5hd2-sata.c
+++ b/
drivers/phy/phy-hix5hd2-sata.c
@@
-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;