diff options
| author | Ian Abbott <[email protected]> | 2013-04-04 14:59:08 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2013-04-05 14:33:20 -0700 |
| commit | 7f4656c5f780520262f7eeda926844761e859c6b (patch) | |
| tree | e60997be79a6a353d9b301738536277fbdc33b7c /tools/perf/scripts/python | |
| parent | 7a4e5a9f3c9f002b36fa91c1accae8f9b5c66cc8 (diff) | |
staging: comedi: get mutex before subdevice in attribute functions
The comedi device attribute functions such as
`show_read_buffer_kb()` or `show_write_buffer_kb()` call
`comedi_read_subdevice()` or `comedi_write_subdevice()` without
acquiring the comedi device's mutex first, although the functions do
acquire the mutex afterwards. Change them to acquire the mutex first.
This is consistent with most of the comedi device file operation
functions (apart from `comedi_read()` and `comedi_write()` which
probably need looking at).
Despite the use of the mutex, there are still race conditions as the
`struct comedi_file_info *info` variable value set before acquiring the
mutex could be stale after acquiring the mutex. This problem will be
dealt with once reference counting has been implemented for the comedi
devices.
This patch also adds local variable `struct comedi_device *dev` to the
functions to reduce the use of the `info` variable a little bit.
Signed-off-by: Ian Abbott <[email protected]>
Reviewed-by: H Hartley Sweeten <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions