diff options
author | Evgeny Novikov <novikov@ispras.ru> | 2020-06-23 17:12:30 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-06-25 15:40:27 +0200 |
commit | 11507bf9a8832741db69efd32bf09a2ab26426bf (patch) | |
tree | c4325663044a2b4bb121ac957156658fc9bc8fef /drivers/staging/rts5208 | |
parent | 8ce8668bfb64f2973cc1276c54619aceede6498a (diff) |
staging: rts5208: fix memleaks on error handling paths in probe
rtsx_probe() allocates host, but does not free it on error handling
paths. The patch adds missed scsi_host_put().
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
Link: https://lore.kernel.org/r/20200623141230.7258-1-novikov@ispras.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rts5208')
-rw-r--r-- | drivers/staging/rts5208/rtsx.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c index be0053c795b7..937f4e732a75 100644 --- a/drivers/staging/rts5208/rtsx.c +++ b/drivers/staging/rts5208/rtsx.c @@ -972,6 +972,7 @@ ioremap_fail: kfree(dev->chip); chip_alloc_fail: dev_err(&pci->dev, "%s failed\n", __func__); + scsi_host_put(host); scsi_host_alloc_fail: pci_release_regions(pci); return err; |