Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6889988imu; Mon, 3 Dec 2018 04:37:36 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xpi+H1GYtsHb2CsqIEvDTssEMNHsBGVqBAGW9C5FJwJpdFmSiSMx4+uaEVwrvDkHrCln3f X-Received: by 2002:a17:902:145:: with SMTP id 63mr3740031plb.256.1543840656206; Mon, 03 Dec 2018 04:37:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543840656; cv=none; d=google.com; s=arc-20160816; b=uuslH89T5OrUpTVGMsvvcBaUnk5eCrjN3RkyElWMubMkZJ0VwrcHw7smF8c60l0SNl gfTQvt/iJ95JmOS0WLuJM2S+hlJ3ni0qmS5fjpESXX198lIs/AqFRXLt0We2Z6KlmRZl u89U3kg9OBN0uoOr/vDCOzNrtEJuWw6NSD6dev8p7awKBRimxTmOIxz/9Fza3djbZnqw ppEMsCKiqnrWCe3PLrQJsoBsoQ4U1XNR9GE37fBQJ2piI4A2tshHtJ407vjyesFp2SKd OmAoCZOXFqTFU+EmAIQ7rrMQnuykYhXRiLBENMbxlH6Koy6hDBSr2Nx1MbnJ8p8uhIg9 JMPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=LFIIS9usqqP4DGp6KTs6krL04RF3iQCo5DqXzeC84Ok=; b=QAzpAj7YbZB14ZeiCY+BAYbTAbgyzZp+2oiLUm595frR+2ouS2nC8+dqIOrSuyqa6k S8JCgTK3Bg3tS7CrG4VWxz6Mhm8uF0g1wROWqal6UrVVOX06g497pU+U3boXo9coHXb5 B4JJjUoQSh1wurGG/Osw7o3B17pxt6s+bbYOrIFyrviiMT80li/2NdZEn5V+q1eqBLMY GcxMdugxpYjn0ujH5/Ar3KfxPLHOjuIv9Qm9YKBaDD1DiH32YZsOFyYLBTC9C/2+xREN T3piJHCwXbRiMt5ZxVqGyiJth6yCZ/9QyMhpoKysKnfHpdprY1LVASW3kf4Jp1bnSpT5 e8Vg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x128si14447956pfb.128.2018.12.03.04.37.20; Mon, 03 Dec 2018 04:37:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726433AbeLCMgU (ORCPT + 99 others); Mon, 3 Dec 2018 07:36:20 -0500 Received: from smtp.ctxuk.citrix.com ([185.25.65.24]:41657 "EHLO SMTP.EU.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726394AbeLCMgT (ORCPT ); Mon, 3 Dec 2018 07:36:19 -0500 X-IronPort-AV: E=Sophos;i="5.56,310,1539648000"; d="scan'208";a="82686130" Date: Mon, 3 Dec 2018 13:35:19 +0100 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= CC: Boris Ostrovsky , Juergen Gross , Stefano Stabellini , Dwayne Litzenberger , , Subject: Re: [Xen-devel] [PATCH 1/2] xen-pciback: Fix error return in bar_write() and rom_write() Message-ID: <20181203123519.l34a4yx26qle3whb@mac> References: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To AMSPEX02CL02.citrite.net (10.69.22.126) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 02, 2018 at 06:47:32PM +0100, Marek Marczykowski-G?recki wrote: > From: Dwayne Litzenberger I think this requires some description. At least a note that the function is not altered, just errors from pci reads/writes are no longer ignored. > Signed-off-by: Dwayne Litzenberger > --- > drivers/xen/xen-pciback/conf_space_header.c | 24 ++++++++++++++++------ > 1 file changed, 18 insertions(+), 6 deletions(-) > > diff --git a/drivers/xen/xen-pciback/conf_space_header.c b/drivers/xen/xen-pciback/conf_space_header.c > index 10ae24b..697d0a8 100644 > --- a/drivers/xen/xen-pciback/conf_space_header.c > +++ b/drivers/xen/xen-pciback/conf_space_header.c > @@ -135,6 +135,7 @@ static int command_write(struct pci_dev *dev, int offset, u16 value, void *data) > > static int rom_write(struct pci_dev *dev, int offset, u32 value, void *data) > { > + int err = 0; > struct pci_bar_info *bar = data; > > if (unlikely(!bar)) { > @@ -150,17 +151,22 @@ static int rom_write(struct pci_dev *dev, int offset, u32 value, void *data) > bar->which = 1; > else { > u32 tmpval; > - pci_read_config_dword(dev, offset, &tmpval); > + err = pci_read_config_dword(dev, offset, &tmpval); > + if (err) > + goto out; I don't think you need the out label, you could just return err. Adding the label doesn't help in any way IMO, just makes the function one line longer for no reason. Same for the out label added to bar_write. Thanks, Roger.