diff mbox

af_packet: fix typo of "unlikely" conditional in packet_snd

Message ID 1421176811-22594-1-git-send-email-linville@tuxdriver.com
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

John W. Linville Jan. 13, 2015, 7:20 p.m. UTC
Change "unlikely(offset) < 0" to "unlikely(offset < 0)"...

Coverity: CID 1259984

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
Compile tested only...

 net/packet/af_packet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller Jan. 13, 2015, 7:26 p.m. UTC | #1
From: "John W. Linville" <linville@tuxdriver.com>
Date: Tue, 13 Jan 2015 14:20:11 -0500

> Change "unlikely(offset) < 0" to "unlikely(offset < 0)"...
> 
> Coverity: CID 1259984
> 
> Signed-off-by: John W. Linville <linville@tuxdriver.com>

Should be fixed in the 'net' tree by:

commit 46d2cfb192b30d729aef064808ed5ece47cee369
Author: Christoph Jaeger <cj@linux.com>
Date:   Sun Jan 11 13:01:16 2015 -0500

    packet: bail out of packet_snd() if L2 header creation fails
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
John W. Linville Jan. 13, 2015, 9:40 p.m. UTC | #2
On Tue, Jan 13, 2015 at 02:26:04PM -0500, David Miller wrote:
> From: "John W. Linville" <linville@tuxdriver.com>
> Date: Tue, 13 Jan 2015 14:20:11 -0500
> 
> > Change "unlikely(offset) < 0" to "unlikely(offset < 0)"...
> > 
> > Coverity: CID 1259984
> > 
> > Signed-off-by: John W. Linville <linville@tuxdriver.com>
> 
> Should be fixed in the 'net' tree by:
> 
> commit 46d2cfb192b30d729aef064808ed5ece47cee369
> Author: Christoph Jaeger <cj@linux.com>
> Date:   Sun Jan 11 13:01:16 2015 -0500
> 
>     packet: bail out of packet_snd() if L2 header creation fails

Cool, sorry for the noise!
diff mbox

Patch

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 6880f34a529a..9cfe2e1dd8b5 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -2517,7 +2517,7 @@  static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)
 	err = -EINVAL;
 	if (sock->type == SOCK_DGRAM) {
 		offset = dev_hard_header(skb, dev, ntohs(proto), addr, NULL, len);
-		if (unlikely(offset) < 0)
+		if (unlikely(offset < 0))
 			goto out_free;
 	} else {
 		if (ll_header_truncated(dev, len))