[linux-mm-cc] [PATCH] ramzswap: fix NULL pointer dereference on memory allocation failed
Nitin Gupta
ngupta at vflare.org
Fri May 6 10:42:47 EDT 2011
On 05/02/2011 05:21 PM, Kirill A. Shutemov wrote:
> On Fri, Apr 29, 2011 at 09:24:37PM -0400, Nitin Gupta wrote:
>> Hi,
>>
>> On 04/28/2011 11:57 AM, Sergey Evlashev wrote:
>>> From: Kirill A. Shutemov<kirill at shutemov.name>
>>>
>>> reset_devices() uses in ramzswap_ioctl_init_device() error path. So we
>>> have to check if rzs->table was really allocated before freeing it.
>>>
>>> Signed-off-by: Kirill A. Shutemov<kirill at shutemov.name>
>>> Signed-off-by: Sergey Evlashev<sergey.evlashev at nokia.com>
>>> Reported-by: Phil Carmody<ext-phil.2.carmody at nokia.com>
>>
>>
>> Thanks for this fix but I'm no longer maintaining this old ramzswap
>> code. Is there any reason why you can't switch to new zram code.
>
> zram has the same problem. See zram_reset_device().
>
zram_reset_device() is called only when zram->init_done flag is set and
if this flag is set then we know that the table is already allocated.
Thanks,
Nitin
More information about the linux-mm-cc
mailing list