[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen/irq: Propagate the error from init_one_desc_irq() in init_irq_data()


  • To: Julien Grall <julien@xxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 19 Nov 2020 16:11:56 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L2g0sfSw/+FWdj3AvQM0e97FVPhTPT+NA6Gp956jAtk=; b=EgzI0sUZmn6FQM3cIHfv+r+Rp3R7rKSyrcclUdZ+CNK0uBQSaDtpuKM6R1fGeiWrmZCmiZO/0ZNSrx2wexoI9EbFg/k3+OWkm++apxRQcX1+7TsIXVEljCrDGCFhp5tZ68gbV3synxcRdJulO98QOYdo4P1OTtmgL/DixdvAYU9AT1X3DFOPh+3xGrmN3Nk9aR7lsodgTugljb3sNfice+SyFjE+szjG2okW4LU0QDMqftcLs+tZSIv5lesIzvoiS7nZrEcD2hhG2XucRKwau8X79MbXLnmoxK4kvCWu4b0Yxcu9OfVaTkWlb7Bq10884znxhGf0AfuG8zdEw2A+3Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oW4cMNPRBHDFzS4zvLNHV3zbBDgD7mTUo/9T4s74/UCE7p9pwZNzBqW24G+Ppuy1xZ+rzQUJW7o0FIT87SrHzFuu4zoshqFjbM8x9CGGpOUe0JuhlGjv2j83kTZDX75ahiQ3nPyBiw3fga3rBiHla5rMKB/U5AcFxZfLv5fHle6TBugGq5mSWzb4n39qNg+3pFa6y46imzhtTVoKHRe5+KFSLqWYcGiN2+s+RH2fp4zN/M3NZ+aI05fo6n/8uncuaHlbzslJ490lqzFnWW1UrFWYr6YkQvp0N6LR0W3YDNA37qlNtcgKZBZ7fEEmY3qBFZhUvvm5d4Re1FCmLRU5LA==
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 19 Nov 2020 15:12:08 +0000
  • Ironport-sdr: xSPTS7REGbmy1QGHiiJU0pkX2rocQcNWyA9h6QE5IZ/UL5wQ+7eQRMKVqbtMZlD1QfoZt+hCK2 OXLqGSsAeN7B9DVXJ3dR5hlhBPDXYBNzhgv005YriIgv1wDjdhkQI7cabDKr5G1pjmyXA107DJ hCcd86OMw9V2olmRa/ooSEpFtHq0MKTDHWCHE56+JiN84ATclNHs1MIfuPOt0wsLugrXudYITz vEzZ/Om1r1FDPrGazUdh7Dx+R3jfo1obGnQFm7T8fck9h3wdjCGzKoBTuEioYm60pvbxsIa6bx IL0=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Nov 19, 2020 at 02:54:34PM +0000, Julien Grall wrote:
> From: Julien Grall <jgrall@xxxxxxxxxx>
> 
> init_one_desc_irq() can return an error if it is unable to allocate
> memory. While this is unlikely to happen during boot (called from
> init_irq_data()), it is better to harden the code by propagting the
> return value.
> 
> Spotted by coverity.
> 
> CID: 106529
> 
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>

> ---
>  xen/arch/x86/irq.c | 7 ++++++-

Fox x86:
Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

>  2 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
> index 3877657a5277..279d221a2b85 100644
> --- a/xen/arch/arm/irq.c
> +++ b/xen/arch/arm/irq.c
> @@ -88,7 +88,12 @@ static int __init init_irq_data(void)
>      for ( irq = NR_LOCAL_IRQS; irq < NR_IRQS; irq++ )
>      {
>          struct irq_desc *desc = irq_to_desc(irq);
> -        init_one_irq_desc(desc);
> +        int rc;
> +
> +        rc = init_one_irq_desc(desc);

You could init rc at definition.

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.