Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361455
b: refs/heads/master
c: aaa0c23
h: refs/heads/master
i:
  361453: 5ef2e28
  361451: 4c3ae37
  361447: 5cf3f39
  361439: 4ca88eb
v: v3
  • Loading branch information
Zhouyi Zhou authored and David S. Miller committed Mar 15, 2013
1 parent cee9925 commit 8a955c5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1e731cb986d564c4938bcba89ff5f4aea1d8e2fb
refs/heads/master: aaa0c23cb90141309f5076ba5e3bfbd39544b985
12 changes: 12 additions & 0 deletions trunk/drivers/infiniband/hw/cxgb4/cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1575,6 +1575,12 @@ static int c4iw_reconnect(struct c4iw_ep *ep)

neigh = dst_neigh_lookup(ep->dst,
&ep->com.cm_id->remote_addr.sin_addr.s_addr);
if (!neigh) {
pr_err("%s - cannot alloc neigh.\n", __func__);
err = -ENOMEM;
goto fail4;
}

/* get a l2t entry */
if (neigh->dev->flags & IFF_LOOPBACK) {
PDBG("%s LOOPBACK\n", __func__);
Expand Down Expand Up @@ -3053,6 +3059,12 @@ static int rx_pkt(struct c4iw_dev *dev, struct sk_buff *skb)
dst = &rt->dst;
neigh = dst_neigh_lookup_skb(dst, skb);

if (!neigh) {
pr_err("%s - failed to allocate neigh!\n",
__func__);
goto free_dst;
}

if (neigh->dev->flags & IFF_LOOPBACK) {
pdev = ip_dev_find(&init_net, iph->daddr);
e = cxgb4_l2t_get(dev->rdev.lldi.l2t, neigh,
Expand Down
6 changes: 4 additions & 2 deletions trunk/include/net/dst.h
Original file line number Diff line number Diff line change
Expand Up @@ -413,13 +413,15 @@ static inline int dst_neigh_output(struct dst_entry *dst, struct neighbour *n,

static inline struct neighbour *dst_neigh_lookup(const struct dst_entry *dst, const void *daddr)
{
return dst->ops->neigh_lookup(dst, NULL, daddr);
struct neighbour *n = dst->ops->neigh_lookup(dst, NULL, daddr);
return IS_ERR(n) ? NULL : n;
}

static inline struct neighbour *dst_neigh_lookup_skb(const struct dst_entry *dst,
struct sk_buff *skb)
{
return dst->ops->neigh_lookup(dst, skb, NULL);
struct neighbour *n = dst->ops->neigh_lookup(dst, skb, NULL);
return IS_ERR(n) ? NULL : n;
}

static inline void dst_link_failure(struct sk_buff *skb)
Expand Down

0 comments on commit 8a955c5

Please sign in to comment.