public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: Ethan Zhao <ethan.kernel@gmail.com>
Cc: konrad.wilk@oracle.com, pjones@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [SCSI] iscsi_boot_sysfs: Fix a memory leak in iscsi_boot_destroy_kset()
Date: Mon, 09 Dec 2013 18:16:04 -0600	[thread overview]
Message-ID: <52A65D44.7070007@cs.wisc.edu> (raw)
In-Reply-To: <1386581831-312-1-git-send-email-ethan.kernel@gmail.com>

On 12/09/2013 03:37 AM, 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().
> 
> 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);

Thanks. Patch looks ok.

It is probably best to just kill the iscsi_boot_kset use and use the
kset directly. To do that, we would need to make kset's list a klist and
add some iterators then modify iscsi_boot_sysfs.c and iscsi_ibft.c to
use them instead of using the iscsi_boot_kset->kobj_list. I will work on
a patch to do this. But for now your patch is ok.

Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>


      parent reply	other threads:[~2013-12-10  0:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-09  9:37 [PATCH] [SCSI] iscsi_boot_sysfs: Fix a memory leak in iscsi_boot_destroy_kset() Ethan Zhao
2013-12-09 21:30 ` Konrad Rzeszutek Wilk
2013-12-10  6:03   ` Ethan Zhao
2013-12-10 14:11     ` Konrad Rzeszutek Wilk
2013-12-10 18:46       ` Mike Christie
2013-12-11 17:18         ` Konrad Rzeszutek Wilk
2013-12-11 17:19           ` Konrad Rzeszutek Wilk
2013-12-11  2:47       ` Ethan Zhao
2013-12-10  0:16 ` Mike Christie [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52A65D44.7070007@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=ethan.kernel@gmail.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pjones@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox