1. 23 Sep, 2011 3 commits
    • Dan Carpenter's avatar
      ALSA: hdspm - cleanup __user tags in ioctl() · 2ca595ab
      Dan Carpenter authored
      This makes the code cleaner and silences a Sparse complaint:
      sound/pci/rme9652/hdspm.c:6341:23: warning: incorrect type in assignment (incompatible argument 4 (different address spaces))
      sound/pci/rme9652/hdspm.c:6341:23:    expected int ( *ioctl )( ... )
      sound/pci/rme9652/hdspm.c:6341:23:    got int ( static [toplevel] *<noident> )( ... )
      sound/pci/rme9652/hdspm.c:6102:44: warning: dereference of noderef expression
      sound/pci/rme9652/hdspm.c:6225:50: warning: dereference of noderef expression
      sound/pci/rme9652/hdspm.c:6264:50: warning: dereference of noderef expression
      sound/pci/rme9652/hdspm.c:6283:50: warning: dereference of noderef expression
      sound/pci/rme9652/hdspm.c:6289:59: warning: dereference of noderef expression
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      2ca595ab
    • Dan Carpenter's avatar
      ALSA: hdspm - potential info leak in snd_hdspm_hwdep_ioctl() · 643d6bbb
      Dan Carpenter authored
      Smatch has a new check for Rosenberg type information leaks where
      structs are copied to the user with uninitialized stack data in them.
      
      The status struct has a hole in it, and on some paths not all the
      members were initialized.
      
      struct hdspm_status {
              unsigned char              card_type;            /*     0     1 */
              /* XXX 3 bytes hole, try to pack */
              enum hdspm_syncsource      autosync_source;      /*     4     4 */
              long long unsigned int     card_clock;           /*     8     8 */
      
      The hdspm_version struct had holes in it as well.
      
      struct hdspm_version {
              unsigned char              card_type;            /*     0     1 */
              char                       cardname[20];         /*     1    20 */
              /* XXX 3 bytes hole, try to pack */
              unsigned int               serial;               /*    24     4 */
              short unsigned int         firmware_rev;         /*    28     2 */
              /* XXX 2 bytes hole, try to pack */
              int                        addons;               /*    32     4 */
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      643d6bbb
    • Takashi Iwai's avatar
      ALSA: fm801 - Clean up redundant reference to snd_fm801_tea575x_gpios[] · 8e699d2c
      Takashi Iwai authored
      Use macro to improve readability.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      8e699d2c
  2. 22 Sep, 2011 3 commits
  3. 20 Sep, 2011 6 commits
  4. 19 Sep, 2011 1 commit
  5. 16 Sep, 2011 2 commits
  6. 15 Sep, 2011 1 commit
    • Arjan van de Ven's avatar
      ALSA: pcm - fix race condition in wait_for_avail() · 763437a9
      Arjan van de Ven authored
      wait_for_avail() in pcm_lib.c has a race in it (observed in practice by an
      Intel validation group).
      
      The function is supposed to return once space in the buffer has become
      available, or if some timeout happens.  The entity that creates space (irq
      handler of sound driver and some such) will do a wake up on a waitqueue
      that this function registers for.
      
      However there are two races in the existing code
      
      1) If space became available between the caller noticing there was no
         space and this function actually sleeping, the wakeup is missed and the
         timeout condition will happen instead
      
      2) If a wakeup happened but not sufficient space became available, the
         code will loop again and wait for more space.  However, if the second
         wake comes in prior to hitting the schedule_timeout_interruptible(), it
         will be missed, and potentially you'll wait out until the timeout
         happens.
      
      The fix consists of using more careful setting of the current state (so
      that if a wakeup happens in the main loop window, the schedule_timeout()
      falls through) and by checking for available space prior to going into the
      schedule_timeout() loop, but after being on the waitqueue and having the
      state set to interruptible.
      
      [tiwai: the following changes have been added to Arjan's original patch:
       - merged akpm's fix for waitqueue adding order into a single patch
       - reduction of duplicated code of avail check
      ]
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: <stable@kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      763437a9
  7. 14 Sep, 2011 7 commits
  8. 13 Sep, 2011 1 commit
  9. 12 Sep, 2011 5 commits
  10. 06 Sep, 2011 2 commits
  11. 31 Aug, 2011 4 commits
  12. 29 Aug, 2011 1 commit
  13. 26 Aug, 2011 2 commits
  14. 25 Aug, 2011 1 commit
  15. 24 Aug, 2011 1 commit