lkml.org 
[lkml]   [2013]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] [SCSI] iscsi_boot_sysfs: Fix a memory leak in iscsi_boot_destroy_kset()
From
Konrad,

boot_kset was allocated when module loaded by
ibft_init()
iscsi_boot_create_kset()
kzalloc()

but wasn't freed when module unloaded by
ibft_exit()
ibft_cleanup()
iscsi_boot_destroy_kset()

Thanks,
Ethan

On Tue, Dec 10, 2013 at 5:30 AM, Konrad Rzeszutek Wilk
<konrad.wilk@oracle.com> wrote:
> On Mon, Dec 09, 2013 at 05:37:11PM +0800, Ethan Zhao wrote:
>> From: "Ethan Zhao" <ethan.kernel@gmail.com>
>>
>> Load and unload iscsi_ibft module will cause kernel memory leak, fix it
>> in scsi/iscsi_boot_sysfs.c iscsi_boot_destroy_kset().
>>
>
> Is there a stack trace?
>> Signed-off-by: Ethan Zhao <ethan.kernel@gmail.com>
>> ---
>> drivers/scsi/iscsi_boot_sysfs.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/scsi/iscsi_boot_sysfs.c b/drivers/scsi/iscsi_boot_sysfs.c
>> index 14c1c8f..680bf6f 100644
>> --- a/drivers/scsi/iscsi_boot_sysfs.c
>> +++ b/drivers/scsi/iscsi_boot_sysfs.c
>> @@ -490,5 +490,6 @@ void iscsi_boot_destroy_kset(struct iscsi_boot_kset *boot_kset)
>> iscsi_boot_remove_kobj(boot_kobj);
>>
>> kset_unregister(boot_kset->kset);
>> + kfree(boot_kset);
>> }
>> EXPORT_SYMBOL_GPL(iscsi_boot_destroy_kset);
>> --
>> 1.8.3.4 (Apple Git-47)
>>


\
 
 \ /
  Last update: 2013-12-10 07:41    [W:0.088 / U:0.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site