Commit 201a95af authored by David S. Miller's avatar David S. Miller

[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: default avatarDavid S. Miller <davem@davemloft.net>
parent d458fd82
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment