* [PATCH 05/14] staging: comedi: check return code of put_user
@ 2010-09-05 18:32 Kulikov Vasiliy
0 siblings, 0 replies; only message in thread
From: Kulikov Vasiliy @ 2010-09-05 18:32 UTC (permalink / raw)
To: kernel-janitors
Cc: Vasiliy Kulikov, Greg Kroah-Hartman, Ian Abbott, Shawn Bohrer,
Mark Rankilor, Andrea Gelmini, devel, linux-kernel
From: Vasiliy Kulikov <segooon@gmail.com>
Function put_user may fail. Check for it.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
---
I couldn't compile this driver at all, so it is not tested.
drivers/staging/comedi/comedi_fops.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 1409131..a3c7183 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -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,
--
1.7.0.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-09-05 18:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-05 18:32 [PATCH 05/14] staging: comedi: check return code of put_user Kulikov Vasiliy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox