Skip to content

Commit

Permalink
staging: rts5208: fix memleaks on error handling paths in probe
Browse files Browse the repository at this point in the history
[ Upstream commit 11507bf ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
eunovm authored and gregkh committed Sep 3, 2020
1 parent 46381f4 commit 4b0badb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/staging/rts5208/rtsx.c
Expand Up @@ -972,6 +972,7 @@ static int rtsx_probe(struct pci_dev *pci,
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;
Expand Down

0 comments on commit 4b0badb

Please sign in to comment.