scsi: sg: fix minor memory leak in error path
authorTony Battersby <tonyb@cybernetics.com>
Thu, 12 Jul 2018 20:30:45 +0000 (16:30 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Aug 2018 14:20:52 +0000 (16:20 +0200)
commitb4653a3ea3d7e68d4118f0476c72f70288c6c7f4
treea055c412d1edaa3c33d55cc2dd2977390f425573
parent1a08888316d2d69d772391597fadde90d1cf1483
scsi: sg: fix minor memory leak in error path

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@vger.kernel.org>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/sg.c