[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <5243967C.2010203@oracle.com>
Date: Thu, 26 Sep 2013 10:05:48 +0800
From: vaughan <vaughan.cao@...cle.com>
To: Vegard Nossum <vegard.nossum@...cle.com>
CC: James Bottomley <JBottomley@...allels.com>,
linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Douglas Gilbert <dgilbert@...erlog.com>
Subject: Re: [PATCH] sg: fix memory leak
On 09/25/2013 10:26 PM, Vegard Nossum wrote:
> Commit e32c9e6300e3af659cbfe45e90a1e7dcd3572ada introduced a memory
> leak. Fix it.
>
> Cc: stable@...r.kernel.org
> Cc: Vaughan Cao <vaughan.cao@...cle.com>
> Cc: Douglas Gilbert <dgilbert@...erlog.com>
> Signed-off-by: Vegard Nossum <vegard.nossum@...cle.com>
> ---
> drivers/scsi/sg.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
> index 5cbc4bb..a97143f 100644
> --- a/drivers/scsi/sg.c
> +++ b/drivers/scsi/sg.c
> @@ -2060,6 +2060,7 @@ sg_add_sfp(Sg_device * sdp, int dev)
> spin_lock_irqsave(&sdp->sfd_lock, iflags);
> if (sdp->detached) {
> spin_unlock_irqrestore(&sdp->sfd_lock, iflags);
> + kfree(sfp);
> return ERR_PTR(-ENODEV);
> }
> list_add_tail(&sfp->sfd_siblings, &sdp->sfds);
You're right. It's a memory leak.
Vaughan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists