Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753955AbdHRAxz (ORCPT ); Thu, 17 Aug 2017 20:53:55 -0400 Received: from mail-cys01nam02on0075.outbound.protection.outlook.com ([104.47.37.75]:46231 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753930AbdHRAxt (ORCPT ); Thu, 17 Aug 2017 20:53:49 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=David.Daney@cavium.com; From: David Daney To: Linus Walleij , Alexandre Courbot , Mark Rutland , Marc Zyngier , Thomas Gleixner , linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, David Daney Subject: [PATCH v8 4/7] irqdomain: Check for NULL function pointer in irq_domain_free_irqs_hierarchy() Date: Thu, 17 Aug 2017 17:53:33 -0700 Message-Id: <1503017616-3252-5-git-send-email-david.daney@cavium.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1503017616-3252-1-git-send-email-david.daney@cavium.com> References: <1503017616-3252-1-git-send-email-david.daney@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: CO2PR07CA0061.namprd07.prod.outlook.com (10.174.192.29) To CY4PR07MB3493.namprd07.prod.outlook.com (10.171.252.150) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5fa30418-8701-4e52-6c67-08d4e5d394b6 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY4PR07MB3493; X-Microsoft-Exchange-Diagnostics: 1;CY4PR07MB3493;3:r1Sq4gmeFa1rb0rA2iuYBVVAWWR36Hcn5zUinM2GDecxKiCP9Dvgk3PvXU0GKgSsY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qvdFtvcEFr0PknvvHpcgh3ZPIQVGT0aCfr4Jzx1dsPknPRMTpVSOXDhR4hGneoHtDh646EjhRRIz9FNyifCo6OsHa68Up8spDZzewR/X+mfZ2UZn7wfK6+PqMRm1NQ1LhHjJWW+/IxCXVELA2OpeNdx1T4Zh/4H/A8Hk1RkQ8v0PbrWD20jq3LUekyHD39/JE4XyPEsiqiF93nsW85Q0plgZDejT+KhEGihOn5qQPx4A3bcug2UEwP+hWhMvHUb8+YZeBEWm5Auw/QhN+j4B8dzHFBeIbN3ke;4:WhMnnXJW0oUw82sYdK9NvZnQVn2LWSNM+KjIe361wKQeddFGtITSgqT5XD4A23MfyljTvgcb5WHIp2lT5ewQnalK/8B9HdRfYZPAvEz8HUSIJAFHr01nr2WB50wlV9BB0rmZZfcYloRoMpL/tq23iEKdVp9yeeUtFPqzpTRFRcnCQbYFwTXrr8m31k/7wMF5Qw4UpOtqlgALXczO3dluYEmGN/sEfFt3XIzYfyvRBafyNV4IZuRBQamGvR2cJxYh X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6041248)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR07MB3493;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR07MB3493; X-Forefront-PRVS: 040359335D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(189002)(199003)(69596002)(72206003)(50226002)(6116002)(3846002)(4326008)(105586002)(42186005)(2950100002)(6666003)(5003940100001)(4720700003)(76176999)(50986999)(5660300001)(189998001)(7350300001)(53416004)(33646002)(101416001)(53936002)(478600001)(6512007)(50466002)(2906002)(48376002)(7736002)(68736007)(107886003)(66066001)(25786009)(86362001)(47776003)(97736004)(36756003)(106356001)(6486002)(6506006)(305945005)(81156014)(81166006)(8676002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR07MB3493;H:ubuntu.caveonetworks.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR07MB3493;23:4DztTnABMBNZ5wl20VOL2uGmOE5N4rH8Qc32QISt4?= =?us-ascii?Q?x8Qds92EjxznfHY1Qhkfqg5UVCAXfIroIFR4fBEMPmGDLdXGAg+0mmdAxO4B?= =?us-ascii?Q?ZtkBMT4hl85+XtzbTn5pbJGbKX/lo7WGcvXAt/lH+rUKrEanZFhQjX7hRb1o?= =?us-ascii?Q?Oz7w369QOgucylU30J9jEyaS7wnKM37t1WTTqZthHvJLiLlCc3AGgfrYk7GN?= =?us-ascii?Q?/N3sUspnV4X08GimQLxIgAObIL2MeI3sIEevJNBNSFC1lvcLhW5Crr/pULpd?= =?us-ascii?Q?PQyCRQeFZQv7OWGdOGjLVIYx3c2aqfwZl5CKbQqmmHwx+sX4oRj3IsI85edP?= =?us-ascii?Q?lq/7iXBOKbhM0KRUzdKiUQ6AjNdYYFEeG6DwJxvjlR1ul02IyLFALMHsn4sv?= =?us-ascii?Q?b3Zm1GrWuzLola+xphsRxWmti1NGfn9TNcn+3ySOBlQdMMcXK3hEfS9WyN8W?= =?us-ascii?Q?r8MqgW5xQ2yIIaIxPhc6O2KNH3syswOC01vl/7op0jnT14iX3Z48ZixgCwPN?= =?us-ascii?Q?Hupvmd+UQ8MM3F6A5iKw9oNooxzpeYW+XKZjmr4i+uxqq+HBrVZPrN0MkXdv?= =?us-ascii?Q?x1MMhqJT5mpk3veq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OEi31q9SduxRlo5Q8rHW8rp9Q==;5:czoVuRLCZWTvQKpZ80rTebtHfH5bBUHsNFYysaTGACcNqnWvXGpl2W5ik2vfYLNv6bLU9dzaQ4GhN+UQXmwRVjeYajCxWmo36TKGJ640SBO8ZvmMtaRqrK6ryRQ0hvTmya910QSvLhB0Fw4RQEgs9g==;24:jy4Y/DGjVsUeJLv79Ma3SJWMPQ93Bi4d+27H5FUB1Xq170uGyIJcyu4TzOGPmiFZYK1UPAj/t4nMW/mdAjLmyhjhLJHghC0wHU9LlMFuGj0=;7:3tBgqTFC0W0DOH+PvyZZjnaibb0HNAAW7tE/sEXPA+Xp4i2tpZ+xlqlJJcNOn2mPO2df9NsJ7VDOVIZucHMcZxVG9Tfo8FXcc4tDgPWhAIY8RgezYMhBrr9YRS3CVXAKDEb/SB7puMXcKWacsJcVA0JF6+P64JWwDxeCEWZZVmPPAGrITCKH88PYoaLqJKIYkRc3rNtUTl5Y+H12iVuk5MKIwIeyOJN9tHw9zAdzPSA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2017 00:53:45.7292 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3493 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 810 Lines: 26 A follow-on patch will call irq_domain_free_irqs_hierarchy() when the free() function pointer may be NULL. Add a NULL pointer check to handle this new use case. Signed-off-by: David Daney --- kernel/irq/irqdomain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 2093b88..24fda75 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -1362,7 +1362,8 @@ static void irq_domain_free_irqs_hierarchy(struct irq_domain *domain, unsigned int irq_base, unsigned int nr_irqs) { - domain->ops->free(domain, irq_base, nr_irqs); + if (domain->ops->free) + domain->ops->free(domain, irq_base, nr_irqs); } int irq_domain_alloc_irqs_hierarchy(struct irq_domain *domain, -- 1.8.3.1