add missing free sgtable in scsi_init_io error path
PATCH 1/1 add missing free sgtable in scsi_init_io error path
I was testing different errors while running multipath, and becuase of a bug in dm-multiapth I hit the "Incorrect number of segments after building list" error. The attached patch just adds a missing scsi_release_buffers() at the bottom of the scsi_init_io where the table was allocated successfully, but you can return BLKPREP_KILL when someone messes up segment counts.
Mike Christie
drivers/scsi/scsi_lib.c +1 -0
@@ -917,6 +917,7 @@ static int scsi_init_io(struct scsi_cmnd req->current_nr_sectors);/* release the command and kill it */ +scsi_release_buffers (cmd);scsi_put_command (cmd);return BLKPREP_KILL ; }