Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752384AbcCAWWk (ORCPT ); Tue, 1 Mar 2016 17:22:40 -0500 Received: from shards.monkeyblade.net ([149.20.54.216]:42647 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752010AbcCAWVz (ORCPT ); Tue, 1 Mar 2016 17:21:55 -0500 Date: Tue, 01 Mar 2016 17:21:53 -0500 (EST) Message-Id: <20160301.172153.99852560992201587.davem@davemloft.net> To: amitoj1606@gmail.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, julia.lawall@lip6.fr Subject: Re: [PATCH] wan: lmc: Switch to using managed resources From: David Miller In-Reply-To: <20160227170416.GA1339@amitoj-Inspiron-3542> References: <20160227170416.GA1339@amitoj-Inspiron-3542> X-Mailer: Mew version 6.6 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 01 Mar 2016 14:21:55 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 861 Lines: 27 From: Amitoj Kaur Chawla 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.