mfd: pm8921: potential NULL dereference in pm8921_remove()
PATCH 1/1 mfd: pm8921: potential NULL dereference in pm8921_remove()
We assume that "pmic" could be NULL and then dereference it two lines later. I fix this by moving the dereference inside the NULL check.
drivers/mfd/pm8921-core.c +5 -4
@@ -171,11 +171,12 @@ static int pm8921_remove(struct platform_device *pdev) drvdata =platform_get_drvdata (pdev);if (drvdata) pmic = drvdata->pm_chip_data; -if (pmic) +if (pmic) {mfd_remove_devices (pmic->dev); -if (pmic->irq_chip) { -pm8xxx_irq_exit (pmic->irq_chip); - pmic->irq_chip =NULL ; +if (pmic->irq_chip) { +pm8xxx_irq_exit (pmic->irq_chip); + pmic->irq_chip =NULL ; + } }return 0 ;
Just a thought. If you use git format-patch you don't have to hand-craft the [PATCH] part of the subject line.
Quoted 5 lines
We assume that "pmic" could be NULL and then dereference it two lines later. I fix this by moving the dereference inside the NULL check.
Fixes c013f0a56c56 ('mfd: Add pm8xxx irq support')Signed-off-by Dan Carpenter <[email protected]>
Patch applied thanks.
Signature · 8 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 2 lines · Lee Jones
Just a thought. If you use
git format-patchyou don't have to hand-craft the [PATCH] part of the subject line.
The lower case [patch] is annoying?
regards,
dan carpenter
Quoted 5 lines · Dan Carpenter
Quoted 2 lines · Lee Jones
Just a thought. If you use
git format-patchyou don't have to hand-craft the [PATCH] part of the subject line.The lower case [patch] is annoying?
Not particularly. It didn't even make it to 'nit' status.
The pointer was more to aid you than anything. git format-patch is a nice tool with some really useful options.
Signature · 8 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 6 lines · Lee Jones
Quoted 4 lines · Dan Carpenter
Quoted 2 lines · Lee Jones
Just a thought. If you use
git format-patchyou don't have to hand-craft the [PATCH] part of the subject line.
Quoted 6 lines
Quoted 1 line
The lower case [patch] is annoying?
Not particularly. It didn't even make it to 'nit' status.
The pointer was more to aid you than anything.
git format-patchis a nice tool with some really useful options.
It would be hard for me to automate my work flow any more than it currently is. :P
regards,
dan carpenter