[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1591725832.25328194@decadent.org.uk>
Date: Tue, 09 Jun 2020 19:04:34 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org, Denis Kirjanov <kda@...ux-powerpc.org>,
"Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
"Bart Van Assche" <bart.vanassche@....com>,
"Tony Battersby" <tonyb@...ernetics.com>,
"Ewan D. Milne" <emilne@...hat.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
"" <stable@...r.kernel.org>
Subject: [PATCH 3.16 43/61] scsi: sg: fix minor memory leak in error path
3.16.85-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Tony Battersby <tonyb@...ernetics.com>
commit c170e5a8d222537e98aa8d4fddb667ff7a2ee114 upstream.
Fix a minor memory leak when there is an error opening a /dev/sg device.
Fixes: cc833acbee9d ("sg: O_EXCL and other lock handling")
Cc: <stable@...r.kernel.org>
Reviewed-by: Ewan D. Milne <emilne@...hat.com>
Signed-off-by: Tony Battersby <tonyb@...ernetics.com>
Reviewed-by: Bart Van Assche <bart.vanassche@....com>
Signed-off-by: Martin K. Petersen <martin.petersen@...cle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
drivers/scsi/sg.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -2168,6 +2168,7 @@ sg_add_sfp(Sg_device * sdp, int dev)
write_lock_irqsave(&sdp->sfd_lock, iflags);
if (atomic_read(&sdp->detaching)) {
write_unlock_irqrestore(&sdp->sfd_lock, iflags);
+ kfree(sfp);
return ERR_PTR(-ENODEV);
}
list_add_tail(&sfp->sfd_siblings, &sdp->sfds);
Powered by blists - more mailing lists