Re: [PATCH] wan: lmc: Switch to using managed resources
From: David Miller
Date: Tue Mar 01 2016 - 17:22:43 EST
From: Amitoj Kaur Chawla <amitoj1606@xxxxxxxxx>
Date: Sat, 27 Feb 2016 22:34:16 +0530
> @@ -835,23 +835,20 @@ static int lmc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
> err = pci_request_regions(pdev, "lmc");
> if (err) {
> printk(KERN_ERR "lmc: pci_request_region failed\n");
> - goto err_req_io;
> + return err;
> }
>
> /*
> * Allocate our own device structure
> */
> - sc = kzalloc(sizeof(lmc_softc_t), GFP_KERNEL);
> - if (!sc) {
> - err = -ENOMEM;
> - goto err_kzalloc;
You can't get rid of the error paths from here on out, because you still need to
release the PCI regions obtained from pci_request_regions() above.
To be quite honest, unless you are fixing real bugs, managed resource
converstions are more likely to add bugs than do anything truly
useful.
I strongly consider you just drop this change.