diff options
| author | Ian Abbott <abbotti@mev.co.uk> | 2014-10-28 13:15:47 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-10-29 04:18:31 -0400 |
| commit | c1a6eac1694b1236115ee6e93a4efbf02d05fea3 (patch) | |
| tree | a5a03085e14c6fb4c1b02353dcbfc81488fb558a | |
| parent | 7e74783a9db72e5fec30eb6129a63f274df42288 (diff) | |
staging: comedi: widen subdevice number argument in ioctl handlers
For the `COMEDI_LOCK`, `COMEDI_UNLOCK`, `COMEDI_CANCEL`, and
`COMEDI_POLL` ioctls the third argument is a comedi subdevice number.
This is passed as an `unsigned long`, but when it is passed down to the
ioctl command-specific handler functions `do_lock_ioctl()`,
`do_unlock_ioctl()`, `do_cancel_ioctl()`, and `do_poll_ioctl()`, the
value has been narrowed to an `unsigned int`. Pass through the argument
as an `unsigned long` to avoid truncating the value on 64-bit
architectures.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/comedi/comedi_fops.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index a9b7fe52d380..f9f61bda92e2 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c | |||
| @@ -1641,7 +1641,7 @@ static int do_cmdtest_ioctl(struct comedi_device *dev, | |||
| 1641 | 1641 | ||
| 1642 | */ | 1642 | */ |
| 1643 | 1643 | ||
| 1644 | static int do_lock_ioctl(struct comedi_device *dev, unsigned int arg, | 1644 | static int do_lock_ioctl(struct comedi_device *dev, unsigned long arg, |
| 1645 | void *file) | 1645 | void *file) |
| 1646 | { | 1646 | { |
| 1647 | int ret = 0; | 1647 | int ret = 0; |
| @@ -1678,7 +1678,7 @@ static int do_lock_ioctl(struct comedi_device *dev, unsigned int arg, | |||
| 1678 | This function isn't protected by the semaphore, since | 1678 | This function isn't protected by the semaphore, since |
| 1679 | we already own the lock. | 1679 | we already own the lock. |
| 1680 | */ | 1680 | */ |
| 1681 | static int do_unlock_ioctl(struct comedi_device *dev, unsigned int arg, | 1681 | static int do_unlock_ioctl(struct comedi_device *dev, unsigned long arg, |
| 1682 | void *file) | 1682 | void *file) |
| 1683 | { | 1683 | { |
| 1684 | struct comedi_subdevice *s; | 1684 | struct comedi_subdevice *s; |
| @@ -1713,7 +1713,7 @@ static int do_unlock_ioctl(struct comedi_device *dev, unsigned int arg, | |||
| 1713 | nothing | 1713 | nothing |
| 1714 | 1714 | ||
| 1715 | */ | 1715 | */ |
| 1716 | static int do_cancel_ioctl(struct comedi_device *dev, unsigned int arg, | 1716 | static int do_cancel_ioctl(struct comedi_device *dev, unsigned long arg, |
| 1717 | void *file) | 1717 | void *file) |
| 1718 | { | 1718 | { |
| 1719 | struct comedi_subdevice *s; | 1719 | struct comedi_subdevice *s; |
| @@ -1750,7 +1750,7 @@ static int do_cancel_ioctl(struct comedi_device *dev, unsigned int arg, | |||
| 1750 | nothing | 1750 | nothing |
| 1751 | 1751 | ||
| 1752 | */ | 1752 | */ |
| 1753 | static int do_poll_ioctl(struct comedi_device *dev, unsigned int arg, | 1753 | static int do_poll_ioctl(struct comedi_device *dev, unsigned long arg, |
| 1754 | void *file) | 1754 | void *file) |
| 1755 | { | 1755 | { |
| 1756 | struct comedi_subdevice *s; | 1756 | struct comedi_subdevice *s; |
