linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PROBLEM: linux-2.4.20 kernel bug (sound: ac97_codec.c prints garbage)
@ 2003-05-05  8:53 Peter Breitenlohner
  2003-05-05 10:56 ` Alan Cox
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Breitenlohner @ 2003-05-05  8:53 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 745 bytes --]

Hi Alan,

you might not exactly be the right person for this, but at least you are
(have been) associated with sound.

PROBLEM:

1. linux-2.4.20 kernel bug (sound: ac97_codec.c prints garbage)

2. A change in drivers/sound/ac97_codec.c introduced between 2.4.18 and
2.4.20 has the consequence that ac97_codec.c prints garbage to the syslog.

3. sound

4. 2.4.20

8. This ought to be fixed as per the attached patch (or equivalent).

Some comments:
1. the format for the first snprintf is broken ("%0x4X" instead of "%4X").
2. the function should return after the first snprintf.

Possibly all this has already been noticed. If not I would appreciate it that
could be fixed for the upcoming 2.4.21.

regards
Peter Breitenlohner <peb@mppmu.mpg.de>

[-- Attachment #2: Type: TEXT/PLAIN, Size: 627 bytes --]

--- linux-2.4.20/drivers/sound/ac97_codec.c.orig	2002-11-29 00:53:14.000000000 +0100
+++ linux-2.4.20/drivers/sound/ac97_codec.c	2003-05-03 17:43:14.000000000 +0200
@@ -666,11 +666,13 @@
 static char *codec_id(u16 id1, u16 id2, char *buf)
 {
 	if(id1&0x8080)
-		snprintf(buf, 10, "%0x4X:%0x4X", id1, id2);
-	buf[0] = (id1 >> 8);
-	buf[1] = (id1 & 0xFF);
-	buf[2] = (id2 >> 8);
-	snprintf(buf+3, 7, "%d", id2&0xFF);
+		snprintf(buf, 10, "%04X:%04X", id1, id2);
+	else {
+		buf[0] = (id1 >> 8);
+		buf[1] = (id1 & 0xFF);
+		buf[2] = (id2 >> 8);
+		snprintf(buf+3, 7, "%d", id2&0xFF);
+	}
 	return buf;
 }
  

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PROBLEM: linux-2.4.20 kernel bug (sound: ac97_codec.c prints garbage)
  2003-05-05  8:53 PROBLEM: linux-2.4.20 kernel bug (sound: ac97_codec.c prints garbage) Peter Breitenlohner
@ 2003-05-05 10:56 ` Alan Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2003-05-05 10:56 UTC (permalink / raw)
  To: Peter Breitenlohner; +Cc: Alan Cox, linux-kernel

> Possibly all this has already been noticed. If not I would appreciate it that
> could be fixed for the upcoming 2.4.21.

Its fixed in 2.4.21pre yes.

Thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-05-05 10:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-05  8:53 PROBLEM: linux-2.4.20 kernel bug (sound: ac97_codec.c prints garbage) Peter Breitenlohner
2003-05-05 10:56 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).