lkml.org 
[lkml]   [1998]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 2.1.80 miscellanea
Thomas Sailer wrote:
> + if (mixer_devs[dev]->name)
^^^^^^^^^^^^^^^^^^^^^^^^^^
> + strncpy(info.name, mixer_devs[dev]->name, sizeof(info.name));

Changing everything to strncpy is good. Your added test is wrong because
name is an array (not char *) member and cannot be NULL.

Similar changes can be done for get_mixer_info.

Notice that mixer_devs[dev] can be NULL. It is okay to open /dev/mixer0
even if there is no mixer installed. That is usually not the case.

Also, almost any mixer ioctl is possible with other sound devices
(well, so it was meant to be) but there is a bug in the sound driver
which passes the device minor number and not the dev number (minor >>
4).
This will usually fail the test for (dev < 0 || dev >= num_mixers).

IMHO, Thomas' fix (I had a similar one sent to Alan before) clears the
Oops but does not fix the bug, I do not know what the bug is yet
(the ioctl works fine with a good arg, so the Oops is probably from
__copy_to_user). Is there a utility to examine in-memory structures?
I think that somehow the ex_table got corrupted or just not produced
right for this code (this is a long shot... I will check it).

Itai
--
Itai Nahshon nahshon@actcom.co.il
Also nahshon@vnet.ibm.com

\
 
 \ /
  Last update: 2005-03-22 13:41    [W:0.052 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site