From: David S. Miller Date: Fri, 27 Oct 2006 22:26:21 +0000 (-0700) Subject: [APPLETALK]: Fix potential OOPS in atalk_sendmsg(). X-Git-Tag: v2.6.19-rc5~101^2~17 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=201a95afaa324b23188eeec268f6bb0b4b70b710;p=linux-2.6-omap-h63xx.git [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 --- diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index 708e2e0371a..485e35c3b28 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 if (usat->sat_addr.s_net || usat->sat_addr.s_node == ATADDR_ANYNODE) { rt = atrtr_find(&usat->sat_addr); - dev = rt->dev; } else { struct atalk_addr at_hint; @@ -1592,7 +1591,6 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr at_hint.s_net = at->src_net; rt = atrtr_find(&at_hint); - dev = rt->dev; } if (!rt) return -ENETUNREACH;