mfd: qcom_rpm: fix a possible NULL dereference
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- drivers/mfd/qcom_rpm.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/mfd/qcom_rpm.c +2 -0
@@ -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 );
Signature · 1 line
2.4.10
Lee Jones
AppliedQuoted 7 lines · LABBE Corentin
of_match_devicecould return NULL, and so cause a NULL pointer dereference later.Signed-off-by LABBE Corentin <[email protected]>--- drivers/mfd/qcom_rpm.c | 2 ++ 1 file changed, 2 insertions(+)
Applied, thanks.
Quoted 13 lines
drivers/mfd/qcom_rpm.c +2
-0@@ -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 );
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog