aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Miller <davem@davemloft.net>2011-12-02 11:52:39 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-05 15:20:20 -0500
commit51e059bdd62f8da90973edf8a6180bd2c080f866 (patch)
treebdc291e7b6230e34ae26eae6f0bc689bb8b7967b
parenta58b61e5b79bc9ce5f8d7b0cd03e8c6525c657f8 (diff)
cxgb4i: Handle dst_get_neighbour_noref() returning NULL.
Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Roland Dreier <roland@purestorage.com>
-rw-r--r--drivers/scsi/cxgbi/cxgb4i/cxgb4i.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
index c8fd13aadf9c..5a4a3bfc60cf 100644
--- a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
+++ b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
@@ -1127,6 +1127,7 @@ static int init_act_open(struct cxgbi_sock *csk)
1127 struct net_device *ndev = cdev->ports[csk->port_id]; 1127 struct net_device *ndev = cdev->ports[csk->port_id];
1128 struct port_info *pi = netdev_priv(ndev); 1128 struct port_info *pi = netdev_priv(ndev);
1129 struct sk_buff *skb = NULL; 1129 struct sk_buff *skb = NULL;
1130 struct neighbour *n;
1130 unsigned int step; 1131 unsigned int step;
1131 1132
1132 log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK, 1133 log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK,
@@ -1141,7 +1142,12 @@ static int init_act_open(struct cxgbi_sock *csk)
1141 cxgbi_sock_set_flag(csk, CTPF_HAS_ATID); 1142 cxgbi_sock_set_flag(csk, CTPF_HAS_ATID);
1142 cxgbi_sock_get(csk); 1143 cxgbi_sock_get(csk);
1143 1144
1144 csk->l2t = cxgb4_l2t_get(lldi->l2t, dst_get_neighbour_noref(csk->dst), ndev, 0); 1145 n = dst_get_neighbour_noref(csk->dst);
1146 if (!n) {
1147 pr_err("%s, can't get neighbour of csk->dst.\n", ndev->name);
1148 goto rel_resource;
1149 }
1150 csk->l2t = cxgb4_l2t_get(lldi->l2t, n, ndev, 0);
1145 if (!csk->l2t) { 1151 if (!csk->l2t) {
1146 pr_err("%s, cannot alloc l2t.\n", ndev->name); 1152 pr_err("%s, cannot alloc l2t.\n", ndev->name);
1147 goto rel_resource; 1153 goto rel_resource;