From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34757606A31C for ; Mon, 30 Nov 2026 15:15:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=ygIBpxED Received: from list by lists.xenproject.org with outflank-mailman.1507955.1701012 (Exim 4.92) (envelope-from ) id 1xY36L-0007g7-2d; Mon, 30 Nov 2026 15:15:33 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1507955.1701012; Mon, 30 Nov 2026 15:15:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xY36K-0007g0-W6; Mon, 30 Nov 2026 15:15:32 +0000 Received: by outflank-mailman (input) for mailman id 1507955; Mon, 30 Nov 2026 15:15:31 +0000 Received: from mx.expurgate.net ([194.145.224.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xY36J-0007fs-P5 for xen-devel@lists.xenproject.org; Mon, 30 Nov 2026 15:15:31 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xY36J-0062Uh-5H for xen-devel@lists.xenproject.org; Mon, 30 Nov 2026 16:15:31 +0100 Received: from [10.42.69.10] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6b0d930b-bab6-0a2a0a5309dd-0a2a450acffc-20 for ; Mon, 30 Nov 2026 16:15:31 +0100 Received: from [209.85.208.173] (helo=mail-lj1-f173.google.com) by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6b0d9312-f2d2-0a2a450a0019-d155d0adf043-3 for ; Mon, 30 Nov 2026 16:15:31 +0100 Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-3ae85e3685cso74899241fa.2 for ; Mon, 30 Nov 2026 07:15:31 -0800 (PST) Received: from [192.168.0.114] ([91.123.151.27]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5c1bcf33c75sm8536555e87.12.2026.11.30.07.15.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2026 07:15:29 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Post: List-Help: List-Subscribe: , Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20260707 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796051730; x=1796656530; darn=lists.xenproject.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Tkdlq9L291y1ISFL34bYJoDDG+/FS8CQVfl/wtZehzE=; b=ygIBpxEDyjxcD6HfrOpSmHr7zAMNoEqeB9PWaCMFDml4GX6eI5b8SaRq/zgc/s6s1N CIM3tXSi6XVCTKjKt1aenG75run+a3C+IdZYrAlUSrjaA4uiJ8GoJItSpkTj8m9A6JFR uZqImKWGPqJ7+YZdouVmmchmJEi4GTPGOCvZVmPiAJO/ALVXR19aK5+AJcwgpnQ3LVTZ E7UT7DV5IpVZU7NB/LsrjITkRecC62X+PNrYFTcPr5HhO8WpCYs8wYA7GWHP7V81jRRA 8xiz/X7CYPUQ69jNpFWLlWs1hrfjdaPuh6IuwgyWsGZ4Nn71uttKWixo6ZkmNPcoRytO yUwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796051730; x=1796656530; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Tkdlq9L291y1ISFL34bYJoDDG+/FS8CQVfl/wtZehzE=; b=e9mXV1DOKWViSxLHGByntIc+K/uUcI2C4aFGmYzATaBeM00HvHvIgP5lyfliTJd1zb 0VRQIzHOAeaW5SiowjlPJSJ7JgJ4gZQbjgPuct4hJfqCLND4Q+dW1jfMQmhDKVD3lVCm 99Wux9YzBcbuCCyNIY758KfMQmRFBMS0UdJYddOYbjJQEhB2kydhBL+9+X6t7R0xVBzW /iQcFNoBHByX0jg6SYexnuTz7HkGtIS6P5xJuiul4xkS4NyDQv6GFBxI3u81MEHPf4uL +o+Xes2/FsqmudQiQSmr+XSOfevyGNTga/b14ZmP8wHC0AHfZEgY572/Ege7r8TsLYVO XqNg== X-Forwarded-Encrypted: i=1; AL+hErEjoZNfwMz60Xc6foffy/AYbfX7GCqkfINKypFqJJst6GFCD4BKm9X4FrwiPzP9myCmYdqYTcsiPs4=@lists.xenproject.org X-Gm-Message-State: APuU4Z9S6THFJ1+Ks6FfKxZQOmTF0j2Cv9h6XJnumD/9BLxDJ6mgR8b6 anB6PES5rRBFjh101L8WoA75oWqczn/p9JFkbr59nBZQJFVE4iIimjpq X-Gm-Gg: AZFdTZcC5mVih6PlB+kNeYj4zI+aWsryEj+BS0FslL+jKBBqO8GMtgvQhVSO9Wyl4xI xfUdL8mcMdyeuanhrLqgWsn4UF4fDW8h3eARtxEoRWdRuecrRTh6G1gP6hG4xe+n9AgGIi41dMF wKpcTkW5foPK/WowA1Jd5wQklXtv7qPchGo2WfPwdFK8QM2Y1/Oi1we2JMkVO9k0K98NWjhzqVb OHksxj4ghW3QRsnTybYJAibDULwEYBfaRfsZg3EmXQv9W/LpqCZakJD8crYWxFIJeCxyIBQAODe Bfxdf8Fv355fTmAOZhrQFnySGtB4FtknJ2KrM1n+CSoKJ8fULcywjvBXASX+wnLGbttr+oyurUA qCJPrzd8+9ip7prWrq45dCCWpftRMzo8hLDs066AMHXVm4Pjc5/S8js21uVuv7G8Ls5ZIj6vQAa iL2YNBHufXStznw1+t7ktmH9QVgq34mc3aBoOQ8K9kvobwBW8TktWIAYuSkWD8rEDKqVnJqE3La 5resmDlMcETJiyBtzjzgUx3eoxc7iIJ4fXtubeksamqJ0WRayjlMijxSrbH6J516lcht6jl7vnW Z0fbvONmbh66Egs62nZ/27+/Um4C6z93pGxiyJQ6kG12meMRr+MN X-Received: by 2002:a05:6512:1256:b0:5c1:4ef7:d9d with SMTP id 2adb3069b0e04-5c1bc87311bmr11427136e87.53.1796051730155; Mon, 30 Nov 2026 07:15:30 -0800 (PST) Message-ID: <33e27785-3e6e-44ca-b212-b71be1d22981@gmail.com> Date: Mon, 30 Nov 2026 17:15:28 +0200 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/3] pci/rcar: Check dw_pcie_host_probe() return value To: Mykyta Poturai , "xen-devel@lists.xenproject.org" Cc: Oleksandr Tyshchenko , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Andrew Cooper , Anthony PERARD , Jan Beulich , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Oleksii Kurochko , Community Manager References: <20261130-rcar-gen5-pci-host-v2-0-f012dfbee7ec@epam.com> <20261130-rcar-gen5-pci-host-v2-1-f012dfbee7ec@epam.com> Content-Language: ru From: Oleksandr Tyshchenko In-Reply-To: <20261130-rcar-gen5-pci-host-v2-1-f012dfbee7ec@epam.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-purgate-ID: tlsNG-4011c0/1796051731-51CC3CFC-21FCB870/0/0 X-purgate-type: clean X-purgate-size: 1906 X-Spam-Status: No, score=-14.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 30.11.2026 13:50, Mykyta Poturai пишет: Hello Mykyta > dw_pcie_host_probe() returns an ERR_PTR on failure, which was then > passed on to dw_pcie_set_priv(). > > Signed-off-by: Mykyta Poturai Reviewed-by: Oleksandr Tyshchenko I assume we need a "Fixes:" tag. Also ... > --- > v1->v2: > * new patch > --- > xen/arch/arm/pci/pci-host-rcar4.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/xen/arch/arm/pci/pci-host-rcar4.c b/xen/arch/arm/pci/pci-host-rcar4.c > index e1e8eb0ee1..611342f98e 100644 > --- a/xen/arch/arm/pci/pci-host-rcar4.c > +++ b/xen/arch/arm/pci/pci-host-rcar4.c > @@ -193,6 +193,11 @@ static int __init pci_host_rcar4_probe(struct dt_device_node *dev, > > bridge = dw_pcie_host_probe(dev, data, &rcar4_pcie_ops, > &rcar4_pcie_child_ops); > + if ( IS_ERR(bridge) ) ... when looking more closely into what the underlying code can return, I noticed a couple of issues: 1. In dw_pcie_host_probe(), pci_host_common_probe() can return NULL. Since IS_ERR(NULL) is false, dw_pcie_host_probe() misses the failure and dereferences bridge->priv = priv. 2. When ioremap_nocache() fails, dw_pcie_host_probe() returns ERR_PTR(ENXIO) instead of ERR_PTR(-ENXIO). Since IS_ERR(ERR_PTR(ENXIO)) is false, pci_host_rcar4_probe() misses the failure and passes the invalid pointer to dw_pcie_set_priv(). Would you be able to fix those as well, please (ideally in a separate commit on pci-designware.c)? If you would prefer to keep this series focused on R-Car, the pci-designware.c fix could be handled separately. > + { > + ret = PTR_ERR(bridge); > + goto err; > + } > > app_idx = dt_property_match_string(dev, "reg-names", "app"); > if ( app_idx < 0 ) >