Re: [PATCH V3 3/3] scsi: core: put ->shost_gendev.parent in failure handling path
From: Hannes Reinecke <hare@suse.de>
Date: 2021-05-31 06:28:55
On 5/31/21 7:07 AM, Ming Lei wrote:
quoted hunk ↗ jump to hunk
get_device(shost->shost_gendev.parent) is called in scsi_add_host_with_dma(), but its counter pair isn't called in the failure path, so fix it by calling put_device(shost->shost_gendev.parent) in its failure path. Reported-by: John Garry <redacted> Cc: Bart Van Assche <bvanassche@acm.org> Cc: Hannes Reinecke <hare@suse.de> Signed-off-by: Ming Lei <redacted> --- drivers/scsi/hosts.c | 1 + 1 file changed, 1 insertion(+)diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 6cbc3eb16525..6cc43c51b7b3 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c@@ -298,6 +298,7 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev, out_del_dev: device_del(&shost->shost_dev); out_del_gendev: + put_device(shost->shost_gendev.parent); device_del(&shost->shost_gendev); out_disable_runtime_pm: device_disable_async_suspend(&shost->shost_gendev);
This really needs to be folded into the first patch as it's really a bugfix for that. Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer