Merge "spmi-pmic-arb: fix a possible null pointer dereference"

This commit is contained in:
Linux Build Service Account 2016-10-31 20:15:01 -07:00 committed by Gerrit - the friendly Code Review server
commit 30b895d9f1

View file

@ -1005,6 +1005,12 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev)
pa->spmic = ctrl; pa->spmic = ctrl;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "core"); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "core");
if (!res) {
dev_err(&pdev->dev, "core resource not specified\n");
err = -EINVAL;
goto err_put_ctrl;
}
pa->core_size = resource_size(res); pa->core_size = resource_size(res);
if (pa->core_size <= 0x800) { if (pa->core_size <= 0x800) {
dev_err(&pdev->dev, "core_size is smaller than 0x800. Failing Probe\n"); dev_err(&pdev->dev, "core_size is smaller than 0x800. Failing Probe\n");