diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-10-27 18:26:21 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-10-30 18:24:34 -0500 |
commit | 201a95afaa324b23188eeec268f6bb0b4b70b710 (patch) | |
tree | b4821e52a74aefc2a3b766c43b32aaa83a3eca34 /net | |
parent | d458fd82c9bb536e4a582955e88554a02a92bf78 (diff) |
[APPLETALK]: Fix potential OOPS in atalk_sendmsg().
atrtr_find() can return NULL, so do not blindly dereference
rt->dev before we check for rt being NULL.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/appletalk/ddp.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index 708e2e0371af..485e35c3b28b 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c | |||
@@ -1584,7 +1584,6 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr | |||
1584 | 1584 | ||
1585 | if (usat->sat_addr.s_net || usat->sat_addr.s_node == ATADDR_ANYNODE) { | 1585 | if (usat->sat_addr.s_net || usat->sat_addr.s_node == ATADDR_ANYNODE) { |
1586 | rt = atrtr_find(&usat->sat_addr); | 1586 | rt = atrtr_find(&usat->sat_addr); |
1587 | dev = rt->dev; | ||
1588 | } else { | 1587 | } else { |
1589 | struct atalk_addr at_hint; | 1588 | struct atalk_addr at_hint; |
1590 | 1589 | ||
@@ -1592,7 +1591,6 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr | |||
1592 | at_hint.s_net = at->src_net; | 1591 | at_hint.s_net = at->src_net; |
1593 | 1592 | ||
1594 | rt = atrtr_find(&at_hint); | 1593 | rt = atrtr_find(&at_hint); |
1595 | dev = rt->dev; | ||
1596 | } | 1594 | } |
1597 | if (!rt) | 1595 | if (!rt) |
1598 | return -ENETUNREACH; | 1596 | return -ENETUNREACH; |