Colin Ian King f170396c14 scsi: fix memory leak of sdpk on when gd fails to allocate
On an allocation failure of gd, the current exit path is via
out_free_devt which leaves sdpk still allocated and hence it gets
leaked. Fix this by correcting the order of resource free'ing with a
change in the error exit path labels.

Detected by CoverityScan, CID#1399519 ("Resource Leak")

Fixes: 0dba1314d4f81115dc ("scsi, block: fix duplicate bdi name registration crashes")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-02-22 19:20:32 -05:00
..
2017-02-22 11:44:32 -08:00
2017-02-22 10:30:38 -08:00
2017-02-20 14:23:40 +01:00
2017-02-22 10:46:44 -08:00
2017-02-20 16:42:43 -08:00
2017-02-21 16:58:32 -08:00
2017-02-21 11:51:42 -08:00
2017-02-21 12:04:54 -08:00
2017-02-21 10:57:33 -08:00
2017-02-22 11:44:32 -08:00
2017-02-22 11:15:59 -08:00
2017-01-25 16:11:55 +00:00
2017-02-20 17:23:57 -08:00
2017-01-30 14:39:20 +01:00
2017-02-20 17:55:15 -08:00
2017-02-20 14:22:50 +01:00
2017-02-14 10:20:35 -08:00
2017-02-22 11:15:59 -08:00
2017-02-20 16:42:43 -08:00
2017-02-11 20:59:41 -05:00