[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:
committed by
David S. Miller
parent
749bf9215e
commit
e4ce837de9
@@ -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,
|
|||||||
}
|
}
|
||||||
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 @@ out_put_nb:
|
|||||||
|
|
||||||
out_put_route:
|
out_put_route:
|
||||||
x25_route_put(rt);
|
x25_route_put(rt);
|
||||||
|
|
||||||
|
out_no_route:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user