Skip to contentSkip to conversation

sound/oss/cs46xx.c: fix a check after use

PATCH In review Adrian Bunk 2 participants 2 messages Apr 13, 2005 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sound/oss/cs46xx.c: fix a check after use

This patch fixes a check after use found by the Coverity checker.

---

This patch was already sent on:
- 27 Mar 2005

sound/oss/cs46xx.c renamed from sound/oss/cs46xx.c.old +2 -1
@@ -3086,13 +3086,14 @@
  
 static void amp_hercules(struct cs_card *card, int change)
 {
-	int old=card->amplifier;
+	int old;
 	if(!card)
 	{
 		CS_DBGOUT(CS_ERROR, 2, printk(KERN_INFO 
 			"cs46xx: amp_hercules() called before initialized.\n"));
 		return;
 	}
+	old = card->amplifier;
 	card->amplifier+=change;
 	if( (card->amplifier && !old) && !(hercules_egpio_disable))
 	{
#1 lore raw
Quoted 1 line · Adrian Bunk

This patch fixes a check after use found by the Coverity checker.

NAK. Please, read the surrounding code. All places that can call that function have form

	<expression>->amplifier_ctrl(<same expression>,...);

so we _can't_ get NULL first argument. The check should be removed - it's not paranoia, it's simple stupidity.