Re: [PATCH] i2c: omap: Prevent NULL pointer dereference in remove

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jean,
Thanks for the review.

On Thu, Aug 30, 2012 at 12:17 AM, Jean Delvare <khali@xxxxxxxxxxxx> wrote:
> On Thu, 23 Aug 2012 19:51:26 +0530, Shubhrajyoti D wrote:
>> Prevent the NULL pointer access of pdev->dev in remove. The platform_device is anyways
>> deleted so remove  platform_set_drvdata(pdev, NULL);.
>
[...]
>
>> @@ -1112,8 +1111,6 @@ static int __devexit omap_i2c_remove(struct platform_device *pdev)
>>       struct resource         *mem;
>>       int ret;
>>
>> -     platform_set_drvdata(pdev, NULL);
>> -
>
> This OTOH is a good catch. But the problem isn't with calling
> platform_set_drvdata(pdev, NULL) per se. The problem is with calling it
> too early. It should be called after i2c_del_adapter(), and ideally
> before freeing the memory.
>

Just  sent a patch implementing your suggestion.
thanks,
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux