Skip to content

Commit

Permalink
net: sun: fix missing release regions in cas_init_one().
Browse files Browse the repository at this point in the history
In cas_init_one(), "pdev" is requested by "pci_request_regions", but it
was not released after a call of the function “pci_write_config_byte”
failed. Thus replace the jump target “err_write_cacheline” by
"err_out_free_res".

Fixes: 1f26dac ("[NET]: Add Sun Cassini driver.")
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
QiushiWu authored and davem330 committed May 22, 2020
1 parent bf655ba commit 5a73015
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/ethernet/sun/cassini.c
Original file line number Diff line number Diff line change
Expand Up @@ -4963,7 +4963,7 @@ static int cas_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
cas_cacheline_size)) {
dev_err(&pdev->dev, "Could not set PCI cache "
"line size\n");
goto err_write_cacheline;
goto err_out_free_res;
}
}
#endif
Expand Down Expand Up @@ -5136,7 +5136,6 @@ static int cas_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
err_out_free_res:
pci_release_regions(pdev);

err_write_cacheline:
/* Try to restore it in case the error occurred after we
* set it.
*/
Expand Down

0 comments on commit 5a73015

Please sign in to comment.