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

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 <clabbe.montjoie@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

LABBE Corentin and committed by
Lee Jones
cf1199f7 bdd5dcf5

+2
+2
drivers/mfd/qcom_rpm.c
··· 495 495 } 496 496 497 497 match = of_match_device(qcom_rpm_of_match, &pdev->dev); 498 + if (!match) 499 + return -ENODEV; 498 500 rpm->data = match->data; 499 501 500 502 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);