From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: andrew.boyer-8PEkshWhKlo@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [bug report] IB/rxe: Unblock loopback by moving skb_out increment
Date: Thu, 22 Dec 2016 15:54:43 +0300 [thread overview]
Message-ID: <20161222125443.GA17758@elgon.mountain> (raw)
Hello Andrew Boyer,
This is a semi-automatic email about new static checker warnings.
The patch d38eb801aa14: "IB/rxe: Unblock loopback by moving skb_out
increment" from Nov 23, 2016, leads to the following Smatch complaint:
drivers/infiniband/sw/rxe/rxe_net.c:458 send()
warn: variable dereferenced before check 'pkt->qp' (see line 441)
drivers/infiniband/sw/rxe/rxe_net.c
440 nskb->destructor = rxe_skb_tx_dtor;
441 nskb->sk = pkt->qp->sk->sk;
^^^^^^^^^
Dereference.
442
443 if (av->network_type == RDMA_NETWORK_IPV4) {
444 err = ip_local_out(dev_net(skb_dst(skb)->dev), nskb->sk, nskb);
445 } else if (av->network_type == RDMA_NETWORK_IPV6) {
446 err = ip6_local_out(dev_net(skb_dst(skb)->dev), nskb->sk, nskb);
447 } else {
448 pr_err("Unknown layer 3 protocol: %d\n", av->network_type);
449 kfree_skb(nskb);
450 return -EINVAL;
451 }
452
453 if (unlikely(net_xmit_eval(err))) {
454 pr_debug("error sending packet: %d\n", err);
455 return -EAGAIN;
456 }
457
458 if (pkt->qp)
^^^^^^^
New check.
459 atomic_inc(&pkt->qp->skb_out);
460 kfree_skb(skb);
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
reply other threads:[~2016-12-22 12:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161222125443.GA17758@elgon.mountain \
--to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
--cc=andrew.boyer-8PEkshWhKlo@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox