staging: rts5208: add missed pci_release_regions
PATCH 1/1 staging: rts5208: add missed pci_release_regions
The driver forgets to call pci_release_regions() in probe failure and remove.
Add the missed calls to fix it.
Signed-off-by Chuhong Yuan <[email protected]>
--- drivers/staging/rts5208/rtsx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/staging/rts5208/rtsx.c +5 -2
@@ -831,7 +831,8 @@ static int rtsx_probe(struct pci_dev *pci, host =scsi_host_alloc (&rtsx_host_template,sizeof (*dev));if (!host) {dev_err (&pci->dev,"Unable to allocate the scsi host\n" ); -return -ENOMEM ; + err = -ENOMEM ; + goto scsi_host_alloc_fail; } dev =host_to_rtsx (host);
@@ -971,7 +972,8 @@ static int rtsx_probe(struct pci_dev *pci,kfree (dev->chip); chip_alloc_fail:dev_err (&pci->dev,"%s failed\n" , __func__); - +scsi_host_alloc_fail: +pci_release_regions (pci);return err; }
@@ -983,6 +985,7 @@ static void rtsx_remove(struct pci_dev *pci)quiesce_and_remove_host (dev);release_everything (dev); +pci_release_regions (pci); }/* PCI IDs */
Signature · 1 line
2.24.0
Quoted 5 lines · Chuhong Yuan
The driver forgets to call
pci_release_regions()in probe failure and remove.
Add the missed calls to fix it.Signed-off-by Chuhong Yuan <[email protected]>
Looks good.
Reviewed-by Dan Carpenter <[email protected]>
regards,
dan carpenter