From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760147Ab1IKMAH (ORCPT ); Sun, 11 Sep 2011 08:00:07 -0400 Received: from gerard.telenet-ops.be ([195.130.132.48]:55884 "EHLO gerard.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760097Ab1IKMAD (ORCPT ); Sun, 11 Sep 2011 08:00:03 -0400 From: Geert Uytterhoeven To: linux-m68k@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Geert Uytterhoeven , Thomas Gleixner Subject: [PATCH 01/28] genirq: Add missing "else" in irq_shutdown() Date: Sun, 11 Sep 2011 13:59:27 +0200 Message-Id: <1315742394-16036-2-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1315742394-16036-1-git-send-email-geert@linux-m68k.org> References: <1315742394-16036-1-git-send-email-geert@linux-m68k.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If an irq_chip provides .irq_shutdown(), but neither of .irq_disable() or .irq_mask(), free_irq() crashes when jumping to NULL. Fix this by only trying .irq_disable() and .irq_mask() if there's no .irq_shutdown() provided. This revives the symmetry with irq_startup(), which tries .irq_startup(), .irq_enable(), and irq_unmask(), and makes it consistent with the comment for irq_chip.irq_shutdown() in , which says: * @irq_shutdown: shut down the interrupt (defaults to ->disable if NULL) This is also how __free_irq() behaved before the big overhaul, cfr. e.g. 3b56f0585fd4c02d047dc406668cb40159b2d340 ("genirq: Remove bogus conditional"), where the core interrupt code always overrode .irq_shutdown() to .irq_disable() if .irq_shutdown() was NULL. Signed-off-by: Geert Uytterhoeven Cc: Thomas Gleixner --- v6: Added this changeset --- kernel/irq/chip.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index d5a3009..dc5114b 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c @@ -178,7 +178,7 @@ void irq_shutdown(struct irq_desc *desc) desc->depth = 1; if (desc->irq_data.chip->irq_shutdown) desc->irq_data.chip->irq_shutdown(&desc->irq_data); - if (desc->irq_data.chip->irq_disable) + else if (desc->irq_data.chip->irq_disable) desc->irq_data.chip->irq_disable(&desc->irq_data); else desc->irq_data.chip->irq_mask(&desc->irq_data); -- 1.7.0.4