Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: hix5hd2-sata: Check return value of platform_get_resource

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>

authored by

Axel Lin and committed by
Kishon Vijay Abraham I
1cbdfc48 0f9722e3

+3
+3
drivers/phy/phy-hix5hd2-sata.c
··· 147 147 return -ENOMEM; 148 148 149 149 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 150 + if (!res) 151 + return -EINVAL; 152 + 150 153 priv->base = devm_ioremap(dev, res->start, resource_size(res)); 151 154 if (!priv->base) 152 155 return -ENOMEM;