Commit e4ce837d authored by Adrian Bunk's avatar Adrian Bunk Committed by David S. Miller

[X25] x25_forward_call(): fix NULL dereferences

This patch fixes two NULL dereferences spotted by the Coverity checker.
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 749bf921
......@@ -26,7 +26,8 @@ int x25_forward_call(struct x25_address *dest_addr, struct x25_neigh *from,
short same_lci = 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) {
/* This shouldnt happen, if it occurs somehow
......@@ -76,7 +77,6 @@ int x25_forward_call(struct x25_address *dest_addr, struct x25_neigh *from,
}
x25_transmit_link(skbn, neigh_new);
rc = 1;
}
out_put_nb:
......@@ -84,6 +84,8 @@ int x25_forward_call(struct x25_address *dest_addr, struct x25_neigh *from,
out_put_route:
x25_route_put(rt);
out_no_route:
return rc;
}
......
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