netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@osdl.org>
To: netdev@oss.sgi.com
Cc: davem@redhat.com, shemminger@osdl.org
Subject: [PATCH 2/4] irda check error on memcpy_fromiovec
Date: Mon, 8 Dec 2003 20:24:14 -0800	[thread overview]
Message-ID: <20031208202414.D30587@build.pdx.osdl.net> (raw)
In-Reply-To: <20031208202302.C30587@build.pdx.osdl.net>; from chrisw@osdl.org on Mon, Dec 08, 2003 at 08:23:02PM -0800

Check the return value on memcpy_fromiovec().


===== net/irda/af_irda.c 1.47 vs edited =====
--- 1.47/net/irda/af_irda.c	Tue Nov  4 16:29:43 2003
+++ edited/net/irda/af_irda.c	Fri Dec  5 17:29:04 2003
@@ -1307,7 +1307,11 @@
 	skb_reserve(skb, self->max_header_size + 16);
 
 	asmptr = skb->h.raw = skb_put(skb, len);
-	memcpy_fromiovec(asmptr, msg->msg_iov, len);
+	err = memcpy_fromiovec(asmptr, msg->msg_iov, len);
+	if (err) {
+		kfree_skb(skb);
+		return err;
+	}
 
 	/*
 	 * Just send the message to TinyTP, and let it deal with possible
@@ -1549,7 +1553,11 @@
 
 	IRDA_DEBUG(4, "%s(), appending user data\n", __FUNCTION__);
 	asmptr = skb->h.raw = skb_put(skb, len);
-	memcpy_fromiovec(asmptr, msg->msg_iov, len);
+	err = memcpy_fromiovec(asmptr, msg->msg_iov, len);
+	if (err) {
+		kfree_skb(skb);
+		return err;
+	}
 
 	/*
 	 * Just send the message to TinyTP, and let it deal with possible
@@ -1612,7 +1620,11 @@
 
 	IRDA_DEBUG(4, "%s(), appending user data\n", __FUNCTION__);
 	asmptr = skb->h.raw = skb_put(skb, len);
-	memcpy_fromiovec(asmptr, msg->msg_iov, len);
+	err = memcpy_fromiovec(asmptr, msg->msg_iov, len);
+	if (err) {
+		kfree_skb(skb);
+		return err;
+	}
 
 	err = irlmp_connless_data_request(self->lsap, skb);
 	if (err) {

  reply	other threads:[~2003-12-09  4:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-09  4:23 [PATCH 1/4] ax25 check error on memcpy_fromiovec Chris Wright
2003-12-09  4:24 ` Chris Wright [this message]
2003-12-09  4:25   ` [PATCH 3/4] netrom " Chris Wright
2003-12-09  4:27     ` [PATCH 4/4] rose " Chris Wright
2003-12-09  5:39 ` [PATCH 1/4] ax25 " David S. Miller
2003-12-09  5:41   ` Chris Wright
2003-12-19 10:34 ` [PATCH 1/5] tun " maximilian attems
2003-12-19 14:23   ` Jeff Garzik
2004-01-17  0:45   ` Chris Wright
2004-01-21 20:49     ` Max Krasnyansky
2004-01-23  2:13       ` Chris Wright

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=20031208202414.D30587@build.pdx.osdl.net \
    --to=chrisw@osdl.org \
    --cc=davem@redhat.com \
    --cc=netdev@oss.sgi.com \
    --cc=shemminger@osdl.org \
    /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 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).