All of lore.kernel.org
 help / color / mirror / Atom feed
From: domen@coderock.org
To: davem@redhat.com
Cc: netdev@oss.sgi.com, domen@coderock.org, yrgrknmxpzlk@gawab.com
Subject: [patch 4/5] net/ipv6/ip6_flowlabel.c: copy_to_user return code
Date: Sun, 06 Mar 2005 23:21:17 +0100	[thread overview]
Message-ID: <20050306222118.401D11ED3D@trashy.coderock.org> (raw)


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;
_

             reply	other threads:[~2005-03-06 22:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-06 22:21 domen [this message]
2005-03-06 22:32 ` [patch 4/5] net/ipv6/ip6_flowlabel.c: copy_to_user return code YOSHIFUJI Hideaki / 吉藤英明
2005-03-06 22:38   ` YOSHIFUJI Hideaki / 吉藤英明
2005-03-07  7:13     ` Stephen Biggs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050306222118.401D11ED3D@trashy.coderock.org \
    --to=domen@coderock.org \
    --cc=davem@redhat.com \
    --cc=netdev@oss.sgi.com \
    --cc=yrgrknmxpzlk@gawab.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.