netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-hams@vger.kernel.org,
	Ralf Baechle <ralf@linux-mips.org>
Subject: [AX.25 4/7] Fix unchecked nr_add_node uses
Date: Thu, 14 Dec 2006 23:42:10 +0100	[thread overview]
Message-ID: <11661361353724-git-send-email-ralf@linux-mips.org> (raw)
In-Reply-To: <11661361331883-git-send-email-ralf@linux-mips.org>

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

 net/netrom/nr_route.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Index: linux-net/net/netrom/nr_route.c
===================================================================
--- linux-net.orig/net/netrom/nr_route.c
+++ linux-net/net/netrom/nr_route.c
@@ -779,9 +779,13 @@ int nr_route_frame(struct sk_buff *skb, 
 	nr_src  = (ax25_address *)(skb->data + 0);
 	nr_dest = (ax25_address *)(skb->data + 7);
 
-	if (ax25 != NULL)
-		nr_add_node(nr_src, "", &ax25->dest_addr, ax25->digipeat,
-			    ax25->ax25_dev->dev, 0, sysctl_netrom_obsolescence_count_initialiser);
+	if (ax25 != NULL) {
+		ret = nr_add_node(nr_src, "", &ax25->dest_addr, ax25->digipeat,
+		                  ax25->ax25_dev->dev, 0,
+		                  sysctl_netrom_obsolescence_count_initialiser);
+		if (ret)
+			return ret;
+	}
 
 	if ((dev = nr_dev_get(nr_dest)) != NULL) {	/* Its for me */
 		if (ax25 == NULL)			/* Its from me */
@@ -846,6 +850,7 @@ int nr_route_frame(struct sk_buff *skb, 
 	ret = (nr_neigh->ax25 != NULL);
 	nr_node_unlock(nr_node);
 	nr_node_put(nr_node);
+
 	return ret;
 }
 

  parent reply	other threads:[~2006-12-14 23:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-14 22:42 [AX.25 1/7] Mark all kmalloc users __must_check Ralf Baechle
2006-12-14 22:42 ` [AX.25 2/7] Fix unchecked ax25_protocol_register uses Ralf Baechle
2006-12-14 23:52   ` David Miller
2006-12-14 22:42 ` [AX.25 3/7] Fix unchecked ax25_listen_register uses Ralf Baechle
2006-12-14 23:52   ` David Miller
2006-12-14 22:42 ` Ralf Baechle [this message]
2006-12-14 23:52   ` [AX.25 4/7] Fix unchecked nr_add_node uses David Miller
2006-12-14 22:42 ` [AX.25 5/7] Fix unchecked ax25_linkfail_register uses Ralf Baechle
2006-12-14 23:53   ` David Miller
2006-12-14 22:42 ` [AX.25 6/7] Fix unchecked rose_add_loopback_node uses Ralf Baechle
2006-12-14 23:53   ` David Miller
2006-12-14 22:42 ` [AX.25 7/7] Fix unchecked rose_add_loopback_neigh uses Ralf Baechle
2006-12-14 23:53   ` David Miller
2006-12-14 23:52 ` [AX.25 1/7] Mark all kmalloc users __must_check David Miller

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=11661361353724-git-send-email-ralf@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=davem@davemloft.net \
    --cc=linux-hams@vger.kernel.org \
    --cc=netdev@vger.kernel.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).