All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Javier González" <javier@javigon.com>
To: wu000273@umn.edu
Cc: kjlu@umn.edu, "Matias Bjorling" <mb@lightnvm.io>,
	"Matias Bjørling" <matias@cnexlabs.com>,
	"Jens Axboe" <axboe@fb.com>, "Javier González" <jg@lightnvm.io>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] lightnvm: pblk: Fix reference count leak in pblk_sysfs_init.
Date: Thu, 28 May 2020 08:28:33 +0200	[thread overview]
Message-ID: <20200528062833.clbghpoqizjvl7g4@mpHalley.localdomain> (raw)
In-Reply-To: <20200527210628.9477-1-wu000273@umn.edu>

On 27.05.2020 16:06, wu000273@umn.edu wrote:
>From: Qiushi Wu <wu000273@umn.edu>
>
>kobject_init_and_add() takes reference even when it fails.
>Thus, when kobject_init_and_add() returns an error,
>kobject_put() must be called to properly clean up the kobject.
>
>Fixes: a4bd217b4326 ("lightnvm: physical block device (pblk) target")
>Signed-off-by: Qiushi Wu <wu000273@umn.edu>
>---
> drivers/lightnvm/pblk-sysfs.c | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/drivers/lightnvm/pblk-sysfs.c b/drivers/lightnvm/pblk-sysfs.c
>index 6387302b03f2..90f1433b19a2 100644
>--- a/drivers/lightnvm/pblk-sysfs.c
>+++ b/drivers/lightnvm/pblk-sysfs.c
>@@ -711,6 +711,7 @@ int pblk_sysfs_init(struct gendisk *tdisk)
> 					"%s", "pblk");
> 	if (ret) {
> 		pblk_err(pblk, "could not register\n");
>+		kobject_put(&pblk->kobj);
> 		return ret;
> 	}
>
>-- 
>2.17.1
>

Looks good to me.

Reviewed-by: Javier González <javier@javigon.com>

  reply	other threads:[~2020-05-28  6:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27 21:06 [PATCH] lightnvm: pblk: Fix reference count leak in pblk_sysfs_init wu000273
2020-05-28  6:28 ` Javier González [this message]
2020-05-29  6:49 ` Matias Bjørling

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=20200528062833.clbghpoqizjvl7g4@mpHalley.localdomain \
    --to=javier@javigon.com \
    --cc=axboe@fb.com \
    --cc=jg@lightnvm.io \
    --cc=kjlu@umn.edu \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matias@cnexlabs.com \
    --cc=mb@lightnvm.io \
    --cc=wu000273@umn.edu \
    /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.