diff options
author | LABBE Corentin <clabbe.montjoie@gmail.com> | 2015-11-12 02:49:59 -0500 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2015-12-04 03:46:23 -0500 |
commit | cf1199f792da92dabfd5dfb2bd2211b5d191da45 (patch) | |
tree | 5dddb6948f4179a2bb4669a2cd5414e227c68069 /drivers/mfd | |
parent | bdd5dcf513847b306621a2059e2ebee910208d8a (diff) |
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>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/qcom_rpm.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) | |||
495 | } | 495 | } |
496 | 496 | ||
497 | match = of_match_device(qcom_rpm_of_match, &pdev->dev); | 497 | match = of_match_device(qcom_rpm_of_match, &pdev->dev); |
498 | if (!match) | ||
499 | return -ENODEV; | ||
498 | rpm->data = match->data; | 500 | rpm->data = match->data; |
499 | 501 | ||
500 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 502 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |