2014-08-02 13:30 GMT+02:00 Wolfram Sang :
> Hi,
>
>> res = platform_get_resource(dev, IORESOURCE_MEM, 0);
>> irq = platform_get_irq(dev, 0);
>> - if (res == NULL || irq < 0) {
>> - ret = -ENODEV;
>> - goto eclk;
>> - }
>> + if (res == NULL || irq < 0)
Hi,
> res = platform_get_resource(dev, IORESOURCE_MEM, 0);
> irq = platform_get_irq(dev, 0);
> - if (res == NULL || irq < 0) {
> - ret = -ENODEV;
> - goto eclk;
> - }
> + if (res == NULL || irq < 0)
> + return -ENODEV;
No need to check f
Fix for possible null pointer dereference, and there was a risk for
memory leak if something unexpected happens and the function returns.
It now uses the Managed Device Resource instead.
Signed-off-by: Rickard Strandqvist
---
drivers/i2c/busses/i2c-pxa.c | 65 ++
This start as a fix for possible null pointer dereference.
But after discussion with especially Wolfram, Jingoo and Emil it was
decided to convert the code to uses Managed Device Resource instead.
Rickard Strandqvist (1):
i2c: busses: i2c-pxa.c: Fix for possible null pointer dereference
drive
4 matches
Mail list logo