scsi: sd_zbc: Fix potential memory leak
authorDamien Le Moal <damien.lemoal@wdc.com>
Thu, 1 Mar 2018 22:19:28 +0000 (07:19 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 7 Mar 2018 03:07:49 +0000 (22:07 -0500)
commit4b433924b2755a94f99258c178684a0e05c344de
tree1c200ef3de0f22a9c8edade733682678ba09a235
parent864449eea7c600596e305ffdc4a6a846414b222c
scsi: sd_zbc: Fix potential memory leak

Rework sd_zbc_check_zone_size() to avoid a memory leak due to an early
return if sd_zbc_report_zones() fails.

Reported-by: David.butterfield <david.butterfield@wdc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Cc: stable@vger.kernel.org
Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/sd_zbc.c