1. 25 Aug, 2014 3 commits
    • David Herrmann's avatar
      HID: uhid: avoid dangling pointers in uhid context · 41c4a464
      David Herrmann authored
      Avoid keeping uhid->rd_data and uhid->rd_size set in case
      uhid_dev_create2() fails. This is non-critical as we never flip
      uhid->running and thus never enter uhid_dev_destroy(). However, it's much
      nicer for debugging if pointers are only set if they point to valid data.
      Signed-off-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      41c4a464
    • David Herrmann's avatar
      HID: uhid: forward create_req to create2_req · 56c47754
      David Herrmann authored
      Instead of hard-coding the uhid_dev_create() function twice, copy any
      create_req into a create2_req structure and forward it.
      
      We allocate uhid_create_req on the stack here, but that should be fine.
      Unlike uhid_create2_req it is fairly small (<1KB) and it's only used
      temporarily to swap entries. uhid_dev_create2() doesn't access it.
      Signed-off-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      56c47754
    • David Herrmann's avatar
      HID: uhid: simplify report-cb shutdown · 0e0d7520
      David Herrmann authored
      The report-query is blocking, so when user-space destroys a device we have
      to wake up any blocking kernel context that is currently in the report-cb.
      We used some broken correlation between @report_done and @running so far.
      Replace it by a much more obvious use.
      
      We now wake up the report-cb if either @report_done or @running is set.
      wake_up() and wait_event() serve as implicit barriers (as they always do)
      so no need to use smp_rmb/wmb directly.
      
      Note that @report_done is never reset by anyone but the report-cb, thus
      it cannot flip twice while we wait for it. And whenever we set @running,
      we afterwards synchronously remove the HID device. Therefore, we wait for
      all report-cbs to finish before we return. This way, @running can never
      flip to true while we wait for it.
      Signed-off-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      0e0d7520
  2. 21 Aug, 2014 11 commits
  3. 20 Aug, 2014 6 commits
  4. 19 Aug, 2014 20 commits