All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Xiaotian Feng <dfeng@redhat.com>
Cc: tj@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] block: fix improper kobject release in blk_integrity_unregister
Date: Tue, 28 Jul 2009 09:10:44 +0200	[thread overview]
Message-ID: <20090728071043.GP4148@kernel.dk> (raw)
In-Reply-To: <1248425548-30600-1-git-send-email-dfeng@redhat.com>

On Fri, Jul 24 2009, Xiaotian Feng wrote:
> blk_integrity_unregister should use kobject_put to release the kobject,
> otherwise after bi is freed, memory of bi->kobj->name is leaked.

Applied, thanks.

> 
> Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
> ---
>  block/blk-integrity.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/block/blk-integrity.c b/block/blk-integrity.c
> index 73e28d3..15c6308 100644
> --- a/block/blk-integrity.c
> +++ b/block/blk-integrity.c
> @@ -379,6 +379,7 @@ void blk_integrity_unregister(struct gendisk *disk)
>  
>  	kobject_uevent(&bi->kobj, KOBJ_REMOVE);
>  	kobject_del(&bi->kobj);
> +	kobject_put(&bi->kobj);
>  	kmem_cache_free(integrity_cachep, bi);
>  	disk->integrity = NULL;
>  }
> -- 
> 1.6.2.5
> 

-- 
Jens Axboe


      reply	other threads:[~2009-07-28  7:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-24  8:52 [PATCH] block: fix improper kobject release in blk_integrity_unregister Xiaotian Feng
2009-07-28  7:10 ` Jens Axboe [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=20090728071043.GP4148@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=dfeng@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.