]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: sun: fix missing release regions in cas_init_one().
authorQiushi Wu <wu000273@umn.edu>
Fri, 22 May 2020 21:50:27 +0000 (16:50 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 May 2020 23:19:46 +0000 (16:19 -0700)
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: 5d78d904a391 ("[NET]: Add Sun Cassini driver.")
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sun/cassini.c

index e6d1aa882fa5b116b224ce9c801664954d075f36..f1c8615ab6f04e4518a4beb58fcd68bf7ebafe14 100644 (file)
@@ -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
@@ -5136,7 +5136,6 @@ err_out_iounmap:
 err_out_free_res:
        pci_release_regions(pdev);
 
-err_write_cacheline:
        /* Try to restore it in case the error occurred after we
         * set it.
         */