scsi: core: Clean up allocation and freeing of sgtables
authorChristoph Hellwig <hch@lst.de>
Mon, 5 Oct 2020 08:41:28 +0000 (10:41 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 8 Oct 2020 01:48:27 +0000 (21:48 -0400)
commit7007e9dd56767a95de0947b3f7599bcc2f21687f
tree2a3419a1303859aaadab9c3d22fa762bdc362332
parent5843cc3d5acd8e6654eb2477f3e48c30e3a2e4f7
scsi: core: Clean up allocation and freeing of sgtables

Rename scsi_init_io() to scsi_alloc_sgtables(), and ensure callers call
scsi_free_sgtables() to cleanup failures close to scsi_init_io() instead of
leaking it down the generic I/O submission path.

Link: https://lore.kernel.org/r/20201005084130.143273-9-hch@lst.de
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_lib.c
drivers/scsi/sd.c
drivers/scsi/sr.c
include/scsi/scsi_cmnd.h