1. 10 Mar, 2009 2 commits
    • Johannes Weiner's avatar
      HID: fix waitqueue usage in hiddev · 96fe2ab8
      Johannes Weiner authored
      DECLARE_WAITQUEUE doesn't initialize the wait descriptor's task_list
      to 'empty' but to zero.
      
      prepare_to_wait() will not enqueue the descriptor to the waitqueue and
      finish_wait() will do list_del_init() on a list head that contains
      NULL pointers, which oopses.
      
      This was introduced by 07903407 "HID: hiddev cleanup -- handle all
      error conditions properly".
      
      The prior code used an unconditional add_to_waitqueue() which didn't
      care about the wait descriptor's list head and enqueued the thing
      unconditionally.
      
      The new code uses prepare_to_wait() which DOES check the prior list
      state, so use DEFINE_WAIT instead.
      Signed-off-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Cc: Oliver Neukum <oliver@neukum.name>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      96fe2ab8
    • Johannes Weiner's avatar
      HID: fix incorrect free in hiddev · 48e7a3c9
      Johannes Weiner authored
      If hiddev_open() fails, it wrongly frees the shared hiddev structure
      kept in hiddev_table instead of the hiddev_list structure allocated
      for the opened file descriptor.  Existing references to this structure
      will then accessed free memory.
      
      This was introduced by 07903407 "HID: hiddev cleanup -- handle all
      error conditions properly".
      Signed-off-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Cc: Oliver Neukum <oliver@neukum.name>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      48e7a3c9
  2. 13 Feb, 2009 33 commits
  3. 12 Feb, 2009 4 commits
  4. 11 Feb, 2009 1 commit