netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/core: another bug fix related to dst_neigh_lookup/dst_neigh_lookup_skb
@ 2013-03-13  8:40 Zhouyi Zhou
  2013-03-13 14:39 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Zhouyi Zhou @ 2013-03-13  8:40 UTC (permalink / raw)
  To: netdev; +Cc: stable, trivial

I do a
/home/zzy/linux-stable#find . -name "*.c"|xargs grep -A 2 dst_neigh_lookup
and find that there are two places in drivers/infiniband/hw/cxgb4/cm.c
do not treat the error return of dst_neigh_lookup/dst_neigh_lookup_skb

Signed-off-by: Zhouyi Zhou <zhouzhouyi <at> gmail.com>

diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 565bfb1..b5d6c4a 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -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 l2e.\n", __func__);
+               err = -ENOMEM;
+               goto fail4;
+       }
+
        /* get a l2t entry */
        if (neigh->dev->flags & IFF_LOOPBACK) {
                PDBG("%s LOOPBACK\n", __func__);
@@ -3052,7 +3058,11 @@ 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 l2t entry!\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,

Thanks for your review

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net/core: another bug fix related to dst_neigh_lookup/dst_neigh_lookup_skb
  2013-03-13  8:40 [PATCH] net/core: another bug fix related to dst_neigh_lookup/dst_neigh_lookup_skb Zhouyi Zhou
@ 2013-03-13 14:39 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-03-13 14:39 UTC (permalink / raw)
  To: zhouzhouyi; +Cc: netdev, stable, trivial

From: Zhouyi Zhou <zhouzhouyi@gmail.com>
Date: Wed, 13 Mar 2013 16:40:49 +0800

> I do a
> /home/zzy/linux-stable#find . -name "*.c"|xargs grep -A 2 dst_neigh_lookup
> and find that there are two places in drivers/infiniband/hw/cxgb4/cm.c
> do not treat the error return of dst_neigh_lookup/dst_neigh_lookup_skb

This patch is also corrupted by your email client.

> 
> Signed-off-by: Zhouyi Zhou <zhouzhouyi <at> gmail.com>

Do not write your email address in your signoff in this way,
you use real email address with a real "@" character rather
than this " <at> " thing.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-13 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-13  8:40 [PATCH] net/core: another bug fix related to dst_neigh_lookup/dst_neigh_lookup_skb Zhouyi Zhou
2013-03-13 14:39 ` David Miller

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).