Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751596AbdHRMWj (ORCPT ); Fri, 18 Aug 2017 08:22:39 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:37874 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750810AbdHRMWi (ORCPT ); Fri, 18 Aug 2017 08:22:38 -0400 MIME-Version: 1.0 In-Reply-To: <5d15388eeb82aed7839b6d842c26168a935c915a.1501610760.git.sathyanarayanan.kuppuswamy@linux.intel.com> References: <5d15388eeb82aed7839b6d842c26168a935c915a.1501610760.git.sathyanarayanan.kuppuswamy@linux.intel.com> From: Andy Shevchenko Date: Fri, 18 Aug 2017 15:22:36 +0300 Message-ID: Subject: Re: [RFC v1 1/6] platform/x86: intel_pmc_ipc: Fix error handling in ipc_pci_probe() To: Kuppuswamy Sathyanarayanan Cc: "x86@kernel.org" , Ingo Molnar , Zha Qipeng , "H. Peter Anvin" , "dvhart@infradead.org" , Thomas Gleixner , Andy Shevchenko , "linux-kernel@vger.kernel.org" , Platform Driver , Sathyanarayanan Kuppuswamy Natarajan Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1093 Lines: 29 On Tue, Aug 1, 2017 at 9:13 PM, wrote: > From: Kuppuswamy Sathyanarayanan > > This patch adds proper error handling for failure cases in > ipc_pci_probe() function. > > Signed-off-by: Kuppuswamy Sathyanarayanan > --- > drivers/platform/x86/intel_pmc_ipc.c | 23 ++++++++++++++++++----- > 1 file changed, 18 insertions(+), 5 deletions(-) > > diff --git a/drivers/platform/x86/intel_pmc_ipc.c b/drivers/platform/x86/intel_pmc_ipc.c > index bb792a5..7b65237 100644 > --- a/drivers/platform/x86/intel_pmc_ipc.c > +++ b/drivers/platform/x86/intel_pmc_ipc.c > @@ -489,33 +489,46 @@ static int ipc_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) > > ret = pci_enable_device(pdev); > if (ret) > - return ret; > + goto release_device; Instead of doing this way and ping-ponging code in the same series, better to switch to managed PCI functions in the first place. -- With Best Regards, Andy Shevchenko