diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2019-04-17 15:39:29 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-19 14:33:41 +0200 |
commit | 77c21b626be5b6b30ca6f76ccd5ba1d14a8278a9 (patch) | |
tree | c54dbfaf09078a152b507ef200f8fbc4da9898f8 /drivers/staging/comedi/comedi_buf.c | |
parent | f439696c81fcfe70ad46554fbec1c851bab9345a (diff) |
staging: comedi: Add lockdep_assert_held() calls for dev->mutex
Lots of functions in the core comedi module expect the mutex in `struct
comedi_device` to be held, so add calls to `lockdep_assert_held()` to
check and document that. An unusual case is the calls to
`lockdep_assert_held()` after successful return from
`comedi_alloc_board_minor()` which allocates a `struct comedi_device`
and returns with its mutex locked.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/comedi_buf.c')
-rw-r--r-- | drivers/staging/comedi/comedi_buf.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c index f693c2c0bec3..d2c8cc72a99d 100644 --- a/drivers/staging/comedi/comedi_buf.c +++ b/drivers/staging/comedi/comedi_buf.c @@ -211,6 +211,8 @@ int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s, { struct comedi_async *async = s->async; + lockdep_assert_held(&dev->mutex); + /* Round up new_size to multiple of PAGE_SIZE */ new_size = (new_size + PAGE_SIZE - 1) & PAGE_MASK; |