* [PATCH 7/9] libcxgbi: Handle dst_get_neighbour_noref() returning NULL.
@ 2011-12-03 2:52 David Miller
2011-12-05 18:57 ` Roland Dreier
0 siblings, 1 reply; 2+ messages in thread
From: David Miller @ 2011-12-03 2:52 UTC (permalink / raw)
To: roland; +Cc: netdev
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/scsi/cxgbi/libcxgbi.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index a026a2f..1d25a87 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -472,6 +472,7 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr)
struct net_device *ndev;
struct cxgbi_device *cdev;
struct rtable *rt = NULL;
+ struct neighbour *n;
struct flowi4 fl4;
struct cxgbi_sock *csk = NULL;
unsigned int mtu = 0;
@@ -493,7 +494,12 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr)
goto err_out;
}
dst = &rt->dst;
- ndev = dst_get_neighbour_noref(dst)->dev;
+ n = dst_get_neighbour_noref(dst);
+ if (!n) {
+ err = -ENODEV;
+ goto rel_rt;
+ }
+ ndev = n->dev;
if (rt->rt_flags & (RTCF_MULTICAST | RTCF_BROADCAST)) {
pr_info("multi-cast route %pI4, port %u, dev %s.\n",
@@ -507,7 +513,7 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr)
ndev = ip_dev_find(&init_net, daddr->sin_addr.s_addr);
mtu = ndev->mtu;
pr_info("rt dev %s, loopback -> %s, mtu %u.\n",
- dst_get_neighbour_noref(dst)->dev->name, ndev->name, mtu);
+ n->dev->name, ndev->name, mtu);
}
cdev = cxgbi_device_find_by_netdev(ndev, &port);
--
1.7.7.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 7/9] libcxgbi: Handle dst_get_neighbour_noref() returning NULL.
2011-12-03 2:52 [PATCH 7/9] libcxgbi: Handle dst_get_neighbour_noref() returning NULL David Miller
@ 2011-12-05 18:57 ` Roland Dreier
0 siblings, 0 replies; 2+ messages in thread
From: Roland Dreier @ 2011-12-05 18:57 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Acked-by: Roland Dreier <roland@purestorage.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-12-05 18:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-03 2:52 [PATCH 7/9] libcxgbi: Handle dst_get_neighbour_noref() returning NULL David Miller
2011-12-05 18:57 ` Roland Dreier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).