mirror of https://gitee.com/openkylin/linux.git
staging: comedi: check return code of put_user
Function put_user may fail. Check for it. Signed-off-by: Vasiliy Kulikov <segooon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
b04462a143
commit
81604d43ad
|
@ -537,7 +537,8 @@ static int do_chaninfo_ioctl(struct comedi_device *dev,
|
|||
|
||||
x = (dev->minor << 28) | (it.subdev << 24) | (i << 16) |
|
||||
(s->range_table_list[i]->length);
|
||||
put_user(x, it.rangelist + i);
|
||||
if (put_user(x, it.rangelist + i))
|
||||
return -EFAULT;
|
||||
}
|
||||
#if 0
|
||||
if (copy_to_user(it.rangelist, s->range_type_list,
|
||||
|
|
Loading…
Reference in New Issue