Skip to contentSkip to conversation

au1550_ac97: spin_unlock in error path

PATCH In review Domen Puncer 3 participants 3 messages Jun 22, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 au1550_ac97: spin_unlock in error path

Error paths didn't spin_unlock.

sound/oss/au1550_ac97.c +5 -2
Index: linux/sound/oss/au1550_ac97.c
===================================================================
@@ -214,7 +214,8 @@ rdcodec(struct ac97_codec *codec, u8 add
 	}
 	if (i == POLL_COUNT) {
 		err("rdcodec: read poll expired!");
-		return 0;
+		data = 0;
+		goto out;
 	}
 
 	/* wait for command done?
@@ -227,7 +228,8 @@ rdcodec(struct ac97_codec *codec, u8 add
 	}
 	if (i == POLL_COUNT) {
 		err("rdcodec: read cmdwait expired!");
-		return 0;
+		data = 0;
+		goto out;
 	}
 
 	data = au_readl(PSC_AC97CDC) & 0xffff;
@@ -238,6 +240,7 @@ rdcodec(struct ac97_codec *codec, u8 add
 	au_writel(PSC_AC97EVNT_CD, PSC_AC97EVNT);
 	au_sync();
 
+ out:
 	spin_unlock_irqrestore(&s->lock, flags);
 
 	return data;
#1 lore raw

Hello.

Quoted 1 line · Domen Puncer

Error paths didn't spin_unlock.

Dang, we missed it while fixing the spinlocks in that driver. Thank you
for noticing. Not sure if Ralf would be eaegr to apply though. :-)

WBR, Sergei

#2 lore raw
Quoted 2 lines · Sergei Shtylyov

Dang, we missed it while fixing the spinlocks in that driver. Thank you
for noticing. Not sure if Ralf would be eaegr to apply though. :-)

I feed it to upstream, so it will eventually show up in the tree on the indirect path.

Ralf