From patchwork Thu Jan 8 12:14:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milton Miller X-Patchwork-Id: 17339 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id D9104DE894 for ; Thu, 8 Jan 2009 23:16:28 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from mercury.realtime.net (mercury.realtime.net [205.238.132.86]) by ozlabs.org (Postfix) with ESMTP id C33384750F for ; Thu, 8 Jan 2009 23:14:39 +1100 (EST) Received: from miltonm.aip.bga.com (01-056.251.popsite.net [205.232.218.56]) by realtime.net (Realtime Communications Advanced E-Mail Services V9.2) with ESMTP id 230062939-1817707 for multiple; Thu, 08 Jan 2009 06:14:21 -0600 Subject: [PATCH 3/4] hvc_console: free_irq only if request_irq was successful From: Milton Miller To: Christian Borntraeger , Benjiman Herrenschmidt Message-Id: In-Reply-To: : Date: Thu, 08 Jan 2009 06:14:21 -0600 X-Originating-IP: 205.232.218.56 Cc: linuxppc-dev list , lkml , Alan Cox , Joe Peterson X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Only call free_irq if we marked the request_irq has having succeeded instead of whenever the the sub-driver identified the interrupt to use. Signed-off-by: Milton Miller Acked-by: Christian Borntraeger --- Appears to be a bugfix but might use a bit of time in -next. This code was created in 2.6.28 to allow s390 to build without adding ifdefs. Many hvc-console sub-drivers have a single channel and are not modules. Index: work.git/drivers/char/hvc_irq.c =================================================================== --- work.git.orig/drivers/char/hvc_irq.c 2009-01-08 04:07:28.000000000 -0600 +++ work.git/drivers/char/hvc_irq.c 2009-01-08 04:07:47.000000000 -0600 @@ -37,7 +37,7 @@ int notifier_add_irq(struct hvc_struct * void notifier_del_irq(struct hvc_struct *hp, int irq) { - if (!irq) + if (!hp->irq_requested) return; free_irq(irq, hp); hp->irq_requested = 0;