[X25] x25_forward_call(): fix NULL dereferences

This patch fixes two NULL dereferences spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Adrian Bunk 2007-03-19 17:04:56 -07:00 committed by David S. Miller
parent 749bf9215e
commit e4ce837de9

View file

@ -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;
}