]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] janitor: fix copy*user in tc/zs
authorRandy Dunlap <rddunlap@osdl.org>
Sat, 6 Sep 2003 07:36:23 +0000 (00:36 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Sat, 6 Sep 2003 07:36:23 +0000 (00:36 -0700)
This patch catches insures proper return values from
copy_to/from_user calls.

From: Ron Gage <ron@rongage.org>

drivers/tc/zs.c

index 3dba0a659aaceb7fb29260d071a8495b14bd196f..23c22db9899863bf4a878f4ce565fea5647e845c 100644 (file)
@@ -1108,7 +1108,7 @@ static int get_serial_info(struct dec_serial * info,
        tmp.close_delay = info->close_delay;
        tmp.closing_wait = info->closing_wait;
        tmp.custom_divisor = info->custom_divisor;
-       return copy_to_user(retinfo,&tmp,sizeof(*retinfo));
+       return copy_to_user(retinfo,&tmp,sizeof(*retinfo)) ? -EFAULT : 0;
 }
 
 static int set_serial_info(struct dec_serial * info,