From patchwork Thu Sep 24 11:06:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 11797071 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D8FF659D for ; Thu, 24 Sep 2020 11:12:09 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9DF5821D91 for ; Thu, 24 Sep 2020 11:12:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uOKgP4H1"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=Synaptics.onmicrosoft.com header.i=@Synaptics.onmicrosoft.com header.b="Jk6IOAGo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9DF5821D91 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=synaptics.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QpqvtWG3pw311PPrWu/1fZwv7pZLvTSK1j3UWcQS4XM=; b=uOKgP4H1OXF7xAoQilBoirRVX MUaduLiaiBBME9fevZYj7P06vIHL0KO4BGak6xVSVXfxZCD9+qZPFvngGGH5MKUk6DEdWNwAJYDLk tWfiyvTForfCYsbPIgAoMVrR0KkWo+2ZF9lmJAdTXfRR+vpkVyC81Lg9zLtRmjbZQhNG8pH8gD3bQ jdqPC1Pm3W35DBuCh7SrTCZtbMEDghdHzV24d68AWsrI6BOqoEAKyXnjurYN6RXPmKBN1WLki7VyC 5CQtqLB7nNzRk1Vrf4FEiy59Fp2p3RxIMHe0hhHJELrDP6bY6dzp0TS0zrG5Fa7lzlqgJdvffQhPa 2YJLHl2CA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLP94-0002ac-QV; Thu, 24 Sep 2020 11:10:38 +0000 Received: from mail-bn8nam08on2056.outbound.protection.outlook.com ([40.107.100.56] helo=NAM04-BN8-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLP90-0002Yo-S3; Thu, 24 Sep 2020 11:10:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bI6sZj9pjliX3u3QjifeWsBYi2gdtehhL8OkVFqpYWLP+Virgb6RRd4CXIbXrxdAQvnYQFC7fqA7heLKSfXXa0EvpJdq5qOUYdxBRmq/nSqP2ErAT3NbrwxjyAYe4mZyT+tKazfEiZ0/53leSZyVDC4BD5hbX7U1XMy7/AZJxeUlr/L2F17fosMJeAcf4pg0q26KcsuLB3e9Uz52456KtDdhtKtY7pBMzxmy06X63j785aA+En3tQ652JJpsQp2uw1svdesQkOx/ByXgVAZQxLjZ0IktY31EbWqaJpYmKREBNpcVbWvtqkftlq+yCWsynlGXvdxEDw8fIngGe4l0qA== 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=Acz77/pflNcVdEV1U42qoD+DQZydsUzkqwBd3G+9rkI=; b=VKZN9Pjtfenp30Da1UlrbguJvYtahjcY19Mhcp0DYEbt68GTp2h+anXqerIMMd6UrBMyK/D5jknakNQ6juAryvcBH3dBSATeJxFV+yHVHxmPOJz6biz5zVZoZuDoQLWaqTRQjMo1AvUMEHR697xaJqxOCDfmrawRME8TgXHu4YIPeKQxQZmGGeK59BeoHZoRsflIdj5zIxa7rKcCCYlQy7b2Tn4zckpSMQvhRtADsK711GCUa0AI33X6j2ONO1z932kkZ5YTuSirQheWXbGamPuA6brryYb4yCkQFelgv4rrPbGDQ42Dao5JiOeDMAPIaYB7nhkMhc2fFr5/kh878Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synaptics.com; dmarc=pass action=none header.from=synaptics.com; dkim=pass header.d=synaptics.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector2-Synaptics-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Acz77/pflNcVdEV1U42qoD+DQZydsUzkqwBd3G+9rkI=; b=Jk6IOAGo0hMtAydUGk9ZxtjtDZdCUH85ScOE373R27xi1fxiFBSdoEk4yIQ7P8RkRQJN1OrNtZ299rFBNrOVRKei6Qs5nVeY+75ZnYm3roShaCxI+zDBwgPrkRSkyDXtBDTG8OjZcESVVq8WiaqjAMITnXYLezE/VMuedOzdC18= Authentication-Results: ti.com; dkim=none (message not signed) header.d=none;ti.com; dmarc=none action=none header.from=synaptics.com; Received: from DM6PR03MB4555.namprd03.prod.outlook.com (2603:10b6:5:102::17) by DM6PR03MB4698.namprd03.prod.outlook.com (2603:10b6:5:180::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.20; Thu, 24 Sep 2020 11:10:33 +0000 Received: from DM6PR03MB4555.namprd03.prod.outlook.com ([fe80::e494:740f:155:4a38]) by DM6PR03MB4555.namprd03.prod.outlook.com ([fe80::e494:740f:155:4a38%7]) with mapi id 15.20.3391.027; Thu, 24 Sep 2020 11:10:33 +0000 Date: Thu, 24 Sep 2020 19:06:23 +0800 From: Jisheng Zhang To: Kishon Vijay Abraham I , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Jingoo Han , Kukjin Kim , Krzysztof Kozlowski , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Yue Wang , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , Jesper Nilsson , Gustavo Pimentel , Xiaowei Song , Binghui Wang , Andy Gross , Bjorn Andersson , Stanimir Varbanov , Pratyush Anand , Thierry Reding , Jonathan Hunter , Kunihiko Hayashi , Masahiro Yamada Subject: [PATCH v2 2/5] PCI: dwc: Check alloc_page() return value Message-ID: <20200924190623.3251c2ac@xhacker.debian> In-Reply-To: <20200924190421.549cb8fc@xhacker.debian> References: <20200924190421.549cb8fc@xhacker.debian> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-ClientProxiedBy: TYAPR01CA0072.jpnprd01.prod.outlook.com (2603:1096:404:2b::36) To DM6PR03MB4555.namprd03.prod.outlook.com (2603:10b6:5:102::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from xhacker.debian (124.74.246.114) by TYAPR01CA0072.jpnprd01.prod.outlook.com (2603:1096:404:2b::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.20 via Frontend Transport; Thu, 24 Sep 2020 11:10:21 +0000 X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-Originating-IP: [124.74.246.114] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9297cf5e-76d2-4fea-a169-08d8607a7492 X-MS-TrafficTypeDiagnostic: DM6PR03MB4698: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1051; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t0btgccwOGojDdAaCv0wgZnNV7PTN/TCuiwSg0FB6OVX9+F/Qk8dnVynC0N31ulPlq3OK5gCgp44WWNxEnSV0PwsP9v3PVu0zV6g1JUPI0f5GT7nzTg81bBOnkFIXUXO3YY04SJ/NSx3MCnY/ZVbeMz6sb6xRQZMma311tRKdi26KUVdUEAFx2dtCLuUfzcqoWyKnj6mIHDu1JGLO4I/mHphOC18G7+HqsJXMbJSQ6vV/oi0W6uapMruuD/ES3esOyT/NIcQ4UJKI+zroy6IsZYx6ZEc9+Fq/6BgiibfIhq3NECEqOzXFvRL9iPGbOrQZlZEQHDk9pvst6dItYg5FFzbZy8/UJXzmEA8NuXLWxV0lB2jT/N8DLb8SkgfgCyX X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR03MB4555.namprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(396003)(366004)(39860400002)(376002)(136003)(2906002)(86362001)(6506007)(52116002)(7696005)(478600001)(5660300002)(186003)(4744005)(66556008)(16526019)(956004)(1076003)(26005)(316002)(66476007)(7406005)(66946007)(9686003)(55016002)(8676002)(8936002)(110136005)(4326008)(7416002)(921003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ThZuJR8ax+hGtWKFSItGEbCRsjR1hkm8jqwn6FE6pwMjVlNErjiiAw7/3GqWJMZKyZ/xBy2Wo0ARd1VoDZCzNPQuzumlhDOnebY0LKZV38005FjqPYn8wAq/X1bzIven6vOjB+UhHJqlAbZjXyafJ3RQajm05duMupTMqWOkuY0iDTwBP3FUEbo/QAlCZlsQL9IxfDp7LRaBxyvF6sJJ/td832GaqDajF5Kf6AvYGOhxIorC3DgXiCeqT8B7nqGcNEE7scN1UC1BL6vGZ9d/YA6DudNV0Fe3b2b0BuMt7pPehY6KrF1VnGJykbExDFHfnF633KEo2FhlswFQek5byOtC5Ay9luGHpjyvfIywmTEaC1oHy6JerSI2ebDIZaksi7LaHUt64bkLgxcKCHuycCWJYJ46sNgMXbbBAKh8pffyhEE/xST/MH6RQejJTAn4GIxz+c3GsVV1V2jGTYMJjvxddIxyZ1XFBZB5wprziBlbaKcyk9HqvtaD0bwef7P9EifDYdi50jZObmq1ZuiwWiOGtq8TY0WzcQChFZ+nVPsMLmgjv/SurcIeC4Ej44zKrk4Z/IO6zsD/39NxBYW3cbam/i6XC8CtPiXjUIwgSjHKoMh3W0xHMSdHeED0ryVopEar0gaFYmk8a+36QHcxXQ== X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9297cf5e-76d2-4fea-a169-08d8607a7492 X-MS-Exchange-CrossTenant-AuthSource: DM6PR03MB4555.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Sep 2020 11:10:33.2917 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0KdVNy1pp8q56TtyKEyqSK+JlCejxU8JAZeVAODVEtdXvVukYoN8MgZuqQPhZRWeP7SO7vx7BL8tuKJ6tiJ0yw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB4698 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200924_071035_444676_92469660 X-CRM114-Status: GOOD ( 12.46 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.100.56 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.100.56 listed in wl.mailspike.net] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@axis.com, linux-arm-msm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org We need to check alloc_page() succeed or not before continuing. Signed-off-by: Jisheng Zhang Acked-by: Gustavo Pimentel --- drivers/pci/controller/dwc/pcie-designware-host.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index 0a19de946351..9e04e8ef3aa4 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -303,6 +303,11 @@ void dw_pcie_msi_init(struct pcie_port *pp) u64 msi_target; pp->msi_page = alloc_page(GFP_KERNEL); + if (!pp->msi_page) { + dev_err(dev, "Failed to alloc MSI page\n"); + return; + } + pp->msi_data = dma_map_page(dev, pp->msi_page, 0, PAGE_SIZE, DMA_FROM_DEVICE); if (dma_mapping_error(dev, pp->msi_data)) {