Commit cf1199f7 authored by LABBE Corentin's avatar LABBE Corentin Committed by Lee Jones

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: default avatarLABBE Corentin <clabbe.montjoie@gmail.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent bdd5dcf5
...@@ -495,6 +495,8 @@ static int qcom_rpm_probe(struct platform_device *pdev) ...@@ -495,6 +495,8 @@ static int qcom_rpm_probe(struct platform_device *pdev)
} }
match = of_match_device(qcom_rpm_of_match, &pdev->dev); match = of_match_device(qcom_rpm_of_match, &pdev->dev);
if (!match)
return -ENODEV;
rpm->data = match->data; rpm->data = match->data;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment