From c2adc8ccca8b66d34544b8cf3d67eda633ab586f Mon Sep 17 00:00:00 2001 From: Mike Isely Date: Sat, 21 Jan 2006 04:44:52 +0000 Subject: Solve pvrusb2 compilation warning We need to be checking the return value for copy_to_user(); for some reason my builds weren't catching this which is why it went unfixed until now. From: Mike Isely Signed-off-by: Mike Isely --- v4l_experimental/pvrusb2/pvrusb2-v4l2.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'v4l_experimental/pvrusb2/pvrusb2-v4l2.c') diff --git a/v4l_experimental/pvrusb2/pvrusb2-v4l2.c b/v4l_experimental/pvrusb2/pvrusb2-v4l2.c index be5c84ae0..9449f775f 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-v4l2.c +++ b/v4l_experimental/pvrusb2/pvrusb2-v4l2.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-v4l2.c,v 1.7 2006/01/14 22:09:52 mcisely Exp $ + * $Id: pvrusb2-v4l2.c,v 1.8 2006/01/21 04:44:52 mcisely Exp $ * * Copyright (C) 2005 Mike Isely * Copyright (C) 2004 Aurelien Alleaume @@ -1073,7 +1073,10 @@ static ssize_t pvr2_v4l2_read(struct file *file, break; } if (!c2) break; - copy_to_user(buff,tbuf,c2); + if (copy_to_user(buff,tbuf,c2)) { + tcnt = -EFAULT; + break; + } offs += c2; tcnt += c2; buff += c2; -- cgit v1.2.3