netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 4/5] net/ipv6/ip6_flowlabel.c: copy_to_user return code
@ 2005-03-06 22:21 domen
  2005-03-06 22:32 ` YOSHIFUJI Hideaki / 吉藤英明
  0 siblings, 1 reply; 4+ messages in thread
From: domen @ 2005-03-06 22:21 UTC (permalink / raw)
  To: davem; +Cc: netdev, domen, yrgrknmxpzlk


compile warning cleanup - handle copy_to/from_user error 
returns

Signed-off-by: Stephen Biggs <yrgrknmxpzlk@gawab.com>
Signed-off-by: Domen Puncer <domen@coderock.org>
---


 kj-domen/net/ipv6/ip6_flowlabel.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff -puN net/ipv6/ip6_flowlabel.c~return_code-net_ipv6_ip6_flowlabel net/ipv6/ip6_flowlabel.c
--- kj/net/ipv6/ip6_flowlabel.c~return_code-net_ipv6_ip6_flowlabel	2005-03-05 16:13:10.000000000 +0100
+++ kj-domen/net/ipv6/ip6_flowlabel.c	2005-03-05 16:13:10.000000000 +0100
@@ -537,9 +537,13 @@ release:
 			goto done;
 
 		/* Do not check for fault */
-		if (!freq.flr_label)
-			copy_to_user(&((struct in6_flowlabel_req __user *) optval)->flr_label,
-				     &fl->label, sizeof(fl->label));
+		if (!freq.flr_label) {
+			if (copy_to_user(&((struct in6_flowlabel_req __user *)optval)->flr_label,
+				     &fl->label, sizeof(fl->label))) {
+				err = -EFAULT;
+				goto done;
+			}
+		}
 
 		sfl1->fl = fl;
 		sfl1->next = np->ipv6_fl_list;
_

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-03-07  7:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-06 22:21 [patch 4/5] net/ipv6/ip6_flowlabel.c: copy_to_user return code domen
2005-03-06 22:32 ` YOSHIFUJI Hideaki / 吉藤英明
2005-03-06 22:38   ` YOSHIFUJI Hideaki / 吉藤英明
2005-03-07  7:13     ` Stephen Biggs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).