From: LABBE Corentin Date: Thu, 12 Nov 2015 07:49:59 +0000 (+0100) Subject: mfd: qcom_rpm: Fix a possible NULL dereference X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cf1199f792da92dabfd5dfb2bd2211b5d191da45;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mfd: qcom_rpm: Fix a possible NULL dereference of_match_device could return NULL, and so cause a NULL pointer dereference later. Signed-off-by: LABBE Corentin Signed-off-by: Lee Jones --- diff --git a/drivers/mfd/qcom_rpm.c b/drivers/mfd/qcom_rpm.c index 207a3bd68559..1be47ad6441b 100644 --- a/drivers/mfd/qcom_rpm.c +++ b/drivers/mfd/qcom_rpm.c @@ -495,6 +495,8 @@ static int qcom_rpm_probe(struct platform_device *pdev) } match = of_match_device(qcom_rpm_of_match, &pdev->dev); + if (!match) + return -ENODEV; rpm->data = match->data; res = platform_get_resource(pdev, IORESOURCE_MEM, 0);