diff options
author | Ming Lei <[email protected]> | 2021-06-02 21:30:27 +0800 |
---|---|---|
committer | Martin K. Petersen <[email protected]> | 2021-06-07 22:12:44 -0400 |
commit | 3719f4ff047e20062b8314c23ec3cab84d74c908 (patch) | |
tree | b1311fbdbf55aa87c1cbdad6613d72d47526edee /drivers/usb/cdns3/cdns3-ti.c | |
parent | 66a834d092930cf41d809c0e989b13cd6f9ca006 (diff) |
scsi: core: Fix failure handling of scsi_add_host_with_dma()
When scsi_add_host_with_dma() returns failure, the caller will call
scsi_host_put(shost) to release everything allocated for this host
instance. Consequently we can't also free allocated stuff in
scsi_add_host_with_dma(), otherwise we will end up with a double free.
Strictly speaking, host resource allocations should have been done in
scsi_host_alloc(). However, the allocations may need information which is
not yet provided by the driver when that function is called. So leave the
allocations where they are but rely on host device's release handler to
free resources.
Link: https://lore.kernel.org/r/[email protected]
Cc: Bart Van Assche <[email protected]>
Cc: John Garry <[email protected]>
Cc: Hannes Reinecke <[email protected]>
Tested-by: John Garry <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>
Reviewed-by: John Garry <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-ti.c')
0 files changed, 0 insertions, 0 deletions