Skip to content

Commit

Permalink
staging: comedi: check return code of put_user
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vasiliy Kulikov authored and Greg Kroah-Hartman committed Sep 5, 2010
1 parent b04462a commit 81604d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 81604d4

Please sign in to comment.