提交 e4ce837d 编写于 作者: A Adrian Bunk 提交者: David S. Miller

[X25] x25_forward_call(): fix NULL dereferences

This patch fixes two NULL dereferences spotted by the Coverity checker.
Signed-off-by: NAdrian Bunk <bunk@stusta.de>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 749bf921
...@@ -26,7 +26,8 @@ int x25_forward_call(struct x25_address *dest_addr, struct x25_neigh *from, ...@@ -26,7 +26,8 @@ int x25_forward_call(struct x25_address *dest_addr, struct x25_neigh *from,
short same_lci = 0; short same_lci = 0;
int rc = 0; int rc = 0;
if ((rt = x25_get_route(dest_addr)) != NULL) { if ((rt = x25_get_route(dest_addr)) == NULL)
goto out_no_route;
if ((neigh_new = x25_get_neigh(rt->dev)) == NULL) { if ((neigh_new = x25_get_neigh(rt->dev)) == NULL) {
/* This shouldnt happen, if it occurs somehow /* This shouldnt happen, if it occurs somehow
...@@ -76,7 +77,6 @@ int x25_forward_call(struct x25_address *dest_addr, struct x25_neigh *from, ...@@ -76,7 +77,6 @@ int x25_forward_call(struct x25_address *dest_addr, struct x25_neigh *from,
} }
x25_transmit_link(skbn, neigh_new); x25_transmit_link(skbn, neigh_new);
rc = 1; rc = 1;
}
out_put_nb: out_put_nb:
...@@ -84,6 +84,8 @@ int x25_forward_call(struct x25_address *dest_addr, struct x25_neigh *from, ...@@ -84,6 +84,8 @@ int x25_forward_call(struct x25_address *dest_addr, struct x25_neigh *from,
out_put_route: out_put_route:
x25_route_put(rt); x25_route_put(rt);
out_no_route:
return rc; return rc;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册