lkml.org 
[lkml]   [2003]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPROBLEM: linux-2.4.20 kernel bug (sound: ac97_codec.c prints garbage)
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>--- 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;
}
\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.041 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site