From nobody Sat May 4 14:15:29 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1582543906; cv=none; d=zohomail.com; s=zohoarc; b=V40yRoc/93R5lzY7tUMtKBizNPckZHtYSwkpD3sRvbFB/fJiFUCCGkZLtV7qXbItg2YtIcbFSyt3WZbJ2enSunoazIbarNgzvsSPuyWWb27kWLvEplXTjimTohzpn0JuENyWskbHtejmyX2rUTkMMkrQUfVOLtYL120AMgy1MoI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582543906; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=nq/KAy6KHV0R+7jrld8ZQnrg9Oa8j7UPH6diPSA14vY=; b=WQdg2m0O/HJD2RKBMC0Ya8y9ji9x1owvR/PIezzfsGy0xxBpLo8Xf95dN2V6LfSRcjO/ZLh0hjpJhwOoCsvpi5aZxtFRgG/MQQ5bKtUC8sCtPb9N+1oq8/Ys1bIpTGfUVrxEU1GI41YSGdd+SK7ww9xrI+Kzo3sA7m5vBYJaJzg= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 15825439063521005.4033765346153; Mon, 24 Feb 2020 03:31:46 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j6Bx0-0001It-NJ; Mon, 24 Feb 2020 11:31:02 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j6Bx0-0001Io-7h for xen-devel@lists.xenproject.org; Mon, 24 Feb 2020 11:31:02 +0000 Received: from huawei.com (unknown [45.249.212.191]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 1f278fac-56f9-11ea-8aec-12813bfff9fa; Mon, 24 Feb 2020 11:30:57 +0000 (UTC) Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C1751EBC4C7848E81306; Mon, 24 Feb 2020 19:30:54 +0800 (CST) Received: from [127.0.0.1] (10.57.101.250) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Mon, 24 Feb 2020 19:30:43 +0800 X-Inumbo-ID: 1f278fac-56f9-11ea-8aec-12813bfff9fa To: "xen-devel@lists.xenproject.org" From: Wei Xu Message-ID: <5E53B3E3.6070304@hisilicon.com> Date: Mon, 24 Feb 2020 19:30:43 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 X-Originating-IP: [10.57.101.250] X-CFilter-Loop: Reflected Subject: [Xen-devel] [PATCH] ns16550: Re-order the serial port address checking X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , "Zengtao \(B\)" , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Linuxarm , xuwei5@hisilicon.com, Shameerali Kolothum Thodi , Jan Beulich Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Check the serial port address space before checking the address. Signed-off-by: Wei Xu Reviewed-by: Jan Beulich --- xen/drivers/char/ns16550.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c index dc8ac4c..425e044 100644 --- a/xen/drivers/char/ns16550.c +++ b/xen/drivers/char/ns16550.c @@ -1644,6 +1644,12 @@ static int __init ns16550_acpi_uart_init(const void = *data) spcr =3D container_of(table, struct acpi_table_spcr, header); + if ( unlikely(spcr->serial_port.space_id !=3D ACPI_ADR_SPACE_SYSTEM_ME= MORY) ) + { + printk("ns16550: Address space type is not mmio\n"); + return -EINVAL; + } + /* * The serial port address may be 0 for example * if the console redirection is disabled. @@ -1654,12 +1660,6 @@ static int __init ns16550_acpi_uart_init(const void = *data) return -EINVAL; } - if ( unlikely(spcr->serial_port.space_id !=3D ACPI_ADR_SPACE_SYSTEM_ME= MORY) ) - { - printk("ns16550: Address space type is not mmio\n"); - return -EINVAL; - } - ns16550_init_common(uart); /* --=20 2.8.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel