From patchwork Tue Feb 8 14:59:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurentiu Tudor X-Patchwork-Id: 12738842 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 97894C433EF for ; Tue, 8 Feb 2022 15:02:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2t+NSKYCp/HvRSb5powmJPbPcbOfR24RgZO9MxTe7sA=; b=0xd3EKYP9YcqOH lqZEXtX7Kv3izct2tGSz4gKEvTbw53+TB/ZB3Qq3ZDDaTHXhwx/CSzJ24B31em9UbqrDm6eUrEC6b oH7cjAOi9yY8HQjJAI8zi03SUl2ZPuPF9HtOj3BK21uVRck7oBjPYbsZfqu1ttY7B4a4yP/WHej1E a/Fq8jdlBbbSjwW9yr7NDhcJq4ihChqDG4pr4sw7/vdrBGsgoeb77hVs/e1dKcgs1rGgii5oF4cLD GrkVV9ke03O1/Kc4CtXAGFfgvVr5lYoenke7PSiFGC+vGe9GkIE8v9qhMLZSMxF/MGGljW89VGjn5 bfqDTdEQTj11znIeJGnw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHRyz-00EM1M-80; Tue, 08 Feb 2022 15:00:41 +0000 Received: from mail-eopbgr30046.outbound.protection.outlook.com ([40.107.3.46] helo=EUR03-AM5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHRyE-00ELgd-0b for linux-arm-kernel@lists.infradead.org; Tue, 08 Feb 2022 14:59:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R3OTk3X/Ol+i+yhjgkS0fO//41Boswx+sheh0IhuvNnYraNt94baVYj5KEcxLLysdcXFGaJDpnSOxVLqBojoa9Of7TepsOt2DbQClNWGSNdB+5nQh0ZIImqxXi4QmsE03G7ovsy+dpE5kHniTuqKOkRX+KLrCAYYvGpXTRk71R74tuPxkTzO3kjzv9xzNBizKABWswoC6LaDdj9NBXT/YpwQe3fLr8m8lp20on7DJbCbB+7xnslt8pDStAG89G3/ZLOvd6qT+oSAfnGzCd8NnuWMPCgHdf7hGt7ENN5RMBpPuaMjMxcs9gMCSUTrUfFkRwiXaaX+wWUeBtviSQSlEQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=l3+UUk7P/HeWsYRBBgClihoYA38mPviFCIkotfl5XKc=; b=CQAqaNhwpaeEdC6osb+r8sRVtfFoaNZiPcKPok+AJCWReIvxqpf2a1+GpV7yUdfkgvUYSsHIGRQhNpnSFmBDHiJbO0PUYFo2GOXeA3fh1gq0hsVZdLFDojEaBjyP9YtYcYrAx+hXi3WkQHaCKzbbo3bdwwcDP89rlSYVMxObBnhTknGEAHch2iDKfwKPMq+RCObyh+2VSxfnmDm9GYS9FL2wztAOGWyI3rSKrZ9h6x0hj31jcTGcRrpAbgZGqtRD5rBPUCKsODBF+0qglVF+Q/gbQ0PfyMqR18fQVw2Oej5ZYpcx/Jhy+Wg8ZZN3Y4hvoVyx3vbOpS8MDeYMTGLzWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l3+UUk7P/HeWsYRBBgClihoYA38mPviFCIkotfl5XKc=; b=NW53n2gGlSH95WjCKktBE+sicJBmgFl1J/Fpdj/fJXaykGrVxiQu/Dqici4K83zU+1vlCRgkEIPWJ77D/+5UKWq5Pbk8bEXJrcovC5vjO9z+Vt/gQRzVS3iofIuEoP9tir52JciJ40Mx50cx5AHJBZxy34Cg0haGiPMqLMHyrtE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR0402MB3405.eurprd04.prod.outlook.com (2603:10a6:803:3::26) by HE1PR04MB3018.eurprd04.prod.outlook.com (2603:10a6:7:1f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.19; Tue, 8 Feb 2022 14:59:42 +0000 Received: from VI1PR0402MB3405.eurprd04.prod.outlook.com ([fe80::f826:3bf6:b77d:5a53]) by VI1PR0402MB3405.eurprd04.prod.outlook.com ([fe80::f826:3bf6:b77d:5a53%7]) with mapi id 15.20.4951.019; Tue, 8 Feb 2022 14:59:42 +0000 From: laurentiu.tudor@nxp.com To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: ioana.ciornei@nxp.com, diana.craciun@oss.nxp.com, jon@solid-run.com, Laurentiu Tudor Subject: [PATCH 4/6] bus: fsl-mc: check for null irq array Date: Tue, 8 Feb 2022 16:59:26 +0200 Message-Id: <20220208145928.12468-5-laurentiu.tudor@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220208145928.12468-1-laurentiu.tudor@nxp.com> References: <20220208145928.12468-1-laurentiu.tudor@nxp.com> X-ClientProxiedBy: AM0PR08CA0025.eurprd08.prod.outlook.com (2603:10a6:208:d2::38) To VI1PR0402MB3405.eurprd04.prod.outlook.com (2603:10a6:803:3::26) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bcd9d908-8bb8-4a7f-dcc9-08d9eb13a2ff X-MS-TrafficTypeDiagnostic: HE1PR04MB3018:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0yG6LTDfYWvugyU3jGCNrxKjuGaAyIC2XzrttiPrf1qR2+eofuyHRbcjc/IshY9iuO/45UHHM+TizQEyjREl02rjpMzVaB8MP1Q4Z+OD8SmLeLTJJcld98f67AhOSH6ATC1EHccgGxi88B9WEpcO6EnrFrm2vE0YMO+cAgC548kN/9NS7DjlSr17kwY+nXYDg+N8LZOeVZkbxRqHOP30w/P2uMFv43co7rgt46zuq61qGxG7mSDEZ/gAuGiBuP4N190xcXeMDwpcPoM9Qzj05nTE8LslHKzaxZld5xVgPn70ikbJQrSLoJr3YBmK0NonRFrV5tP7LJ0KODgIt6TFEnDp618SINZ541wH7pdc0j0tPaAXp4NlH6buGRjrpr/igp+1UCKv1oaDvPwB/LRGAkqNLsC3VC1g9L5ew+HsCQWSGHFHuIEccbnNQNAhCieatwAjgn1dN7Z5o5bGh13zDFaloa+vg5S3RfHYOOBgEoTFiITP1MFqDpqO4SdCa8+10B5ATUVvM/LBORVyDja98kvPGYzSVZvFnE26uPHtSY32voWl4fL8UE1TewEUsa9li4QcF9g6EO7O9dUzoDeylVi0UwxMoXeDRzdmNeuSlmWzV8Yuiz/r2GQwmVSGyH7EUusmPSw5mTKtHPOcBhA7RXEkqa2TmKP6QhGV/omPVMjnbK5TV2/KdrfHDnYld/juI977WYY1l/hgZZOEcI/cdw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0402MB3405.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(2616005)(6666004)(66476007)(316002)(9686003)(66556008)(508600001)(52116002)(4744005)(186003)(6506007)(2906002)(6512007)(1076003)(26005)(5660300002)(6486002)(8676002)(66946007)(4326008)(86362001)(36756003)(83380400001)(8936002)(38350700002)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9XpURDw7C0KEm6/9YuKzx3rW+ZYooivs7K3WiE20AgGqpc0CgyitpLE2OsgtcxWKHb0SjIRgXh/998nV5hCeXAjUfNS52E44kpr2Pgf2MEoLtOjdVoRl+5j5pvinVx4PUlTan+HmY+3KnWUJky7umbKcdVrV6wwzVaF+fUQIKNxD8H7A7P7F/2Gnpb1TdMTt6XfOV0ZQgzXVdmuSbIopPhpigzq0sLV3WSS1hxSujzwz+ktWOZQIn5WnYYKH/GFYyXOihY1ph2q/W+1SfPoR/LyZ0IOphCMmM+A9bFWajohtQvD2ymlefRkQS3fmPqMOs80Eo3dzxNoYvwzo4EnLGSGf605xodEjSRPMrvUqN6PkXb/G39gh0jB2vgLRzhpnztyI8Ij3viiRqKSRfrNPhljjNXzeWWzwSIZAkk5vBx7WCahkPPZeVJdEHpybhfdqZnlMuhe1VcJ8fyAUB3d2kwwQ+LFNQuAq2IXnOMUpJGgfHDMwJx7VSMbEvvkZKh+cjrxz7sgGpQ81Nt7bFAhsFv0HBDz/zC/TxISunoO3AedFUdknf0Vsk5IPGTs5/NXOCF0jb45dj2AlHGJxTgvhe5rdafYdGQQmdVFrw8WS7wLG+lkBt69+4226NgfOwUliMFIu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AuthSource: VI1PR0402MB3405.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2022 14:59:42.3250 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qQDPiXpdRoWDE2SZQpUSyl7+jo+J9rXq6wzRBQt/vSh7mcSGgDn2BGOcCKZd5e538DveANctoHlGBPiPowrbeA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB3018 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220208_065954_115540_5D14C029 X-CRM114-Status: GOOD ( 11.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Laurentiu Tudor In VFIO case, the irq array in the fsl_mc device is not initialized, so given that in upcoming patches this code will also get called by VFIO add a check for null in the irq teardown function. Signed-off-by: Laurentiu Tudor --- drivers/bus/fsl-mc/dprc-driver.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/bus/fsl-mc/dprc-driver.c b/drivers/bus/fsl-mc/dprc-driver.c index 36681cf7c42e..8482c4fca835 100644 --- a/drivers/bus/fsl-mc/dprc-driver.c +++ b/drivers/bus/fsl-mc/dprc-driver.c @@ -767,7 +767,12 @@ static int dprc_probe(struct fsl_mc_device *mc_dev) */ static void dprc_teardown_irq(struct fsl_mc_device *mc_dev) { - struct fsl_mc_device_irq *irq = mc_dev->irqs[0]; + struct fsl_mc_device_irq *irq; + + if (!mc_dev->irqs) + return; + + irq = mc_dev->irqs[0]; (void)disable_dprc_irq(mc_dev);