linux-mips
[Top] [All Lists]

[patch] au1550_ac97: spin_unlock in error path

To: linux-mips@linux-mips.org
Subject: [patch] au1550_ac97: spin_unlock in error path
From: Domen Puncer <domen.puncer@ultra.si>
Date: Thu, 22 Jun 2006 11:29:13 +0200
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.11+cvs20060126
Error paths didn't spin_unlock.

Signed-off-by: Domen Puncer <domen.puncer@ultra.si>


Index: linux/sound/oss/au1550_ac97.c
===================================================================
--- linux.orig/sound/oss/au1550_ac97.c
+++ 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;


<Prev in Thread] Current Thread [Next in Thread>