Skip to contentSkip to conversation

x86: remove superfluous NULL pointer check in destroy_irq()

PATCH In review Bartlomiej Zolnierkiewicz 1 participant 2 messages Jul 30, 2009 – Aug 2, 2009 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: remove superfluous NULL pointer check in destroy_irq()

From: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] x86: remove superfluous NULL pointer check in destroy_irq()

This takes care of the following entry from Dan's list:

arch/x86/kernel/apic/io_apic.c +3241 destroy_irq(11) warning: variable derefenced before check 'desc'

---
 arch/x86/kernel/apic/io_apic.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/kernel/apic/io_apic.c +1 -2
Index: b/arch/x86/kernel/apic/io_apic.c
===================================================================
@@ -3238,8 +3238,7 @@ void destroy_irq(unsigned int irq)
 	cfg = desc->chip_data;
 	dynamic_irq_cleanup(irq);
 	/* connect back irq_cfg */
-	if (desc)
-		desc->chip_data = cfg;
+	desc->chip_data = cfg;
 
 	free_irte(irq);
 	spin_lock_irqsave(&vector_lock, flags);
#1 lore raw

[tip:x86/apic] x86: Remove superfluous NULL pointer check in destroy_irq()

Commit-ID:  25f6e89bedd29cc49bfa0d55497e91a671b9ae6e
Gitweb:     http://git.kernel.org/tip/25f6e89bedd29cc49bfa0d55497e91a671b9ae6e
Author:     Bartlomiej Zolnierkiewicz <[email protected]>
AuthorDate: Thu, 30 Jul 2009 23:21:18 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sun, 2 Aug 2009 21:37:00 +0200

x86: Remove superfluous NULL pointer check in destroy_irq()

This takes care of the following entry from Dan's list:

arch/x86/kernel/apic/io_apic.c +3241 destroy_irq(11) warning: variable derefenced before check 'desc'

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/apic/io_apic.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
arch/x86/kernel/apic/io_apic.c +1 -2
index cf51b0b..7e92a92 100644
@@ -3185,8 +3185,7 @@ void destroy_irq(unsigned int irq)
 	cfg = desc->chip_data;
 	dynamic_irq_cleanup(irq);
 	/* connect back irq_cfg */
-	if (desc)
-		desc->chip_data = cfg;
+	desc->chip_data = cfg;
 
 	free_irte(irq);
 	spin_lock_irqsave(&vector_lock, flags);