|
@@ -1462,10 +1462,6 @@ static int __comedi_get_user_chanlist(struct comedi_device *dev,
|
|
|
unsigned int *chanlist;
|
|
|
int ret;
|
|
|
|
|
|
- /* user_chanlist could be NULL for do_cmdtest ioctls */
|
|
|
- if (!user_chanlist)
|
|
|
- return 0;
|
|
|
-
|
|
|
chanlist = memdup_user(user_chanlist,
|
|
|
cmd->chanlist_len * sizeof(unsigned int));
|
|
|
if (IS_ERR(chanlist))
|
|
@@ -1609,10 +1605,13 @@ static int do_cmdtest_ioctl(struct comedi_device *dev,
|
|
|
|
|
|
s = &dev->subdevices[cmd.subdev];
|
|
|
|
|
|
- /* load channel/gain list */
|
|
|
- ret = __comedi_get_user_chanlist(dev, s, user_chanlist, &cmd);
|
|
|
- if (ret)
|
|
|
- return ret;
|
|
|
+ /* user_chanlist can be NULL for COMEDI_CMDTEST ioctl */
|
|
|
+ if (user_chanlist) {
|
|
|
+ /* load channel/gain list */
|
|
|
+ ret = __comedi_get_user_chanlist(dev, s, user_chanlist, &cmd);
|
|
|
+ if (ret)
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
|
|
|
ret = s->do_cmdtest(dev, s, &cmd);
|
|
|
|