packet: bail out of packet_snd() if L2 header creation fails
[linux-2.6-block.git] / net / packet / af_packet.c
index 6880f34a529a56510b1145e14d41ed04803dd6a7..9cfe2e1dd8b5099bbac7d824241bd0d06cb01cf7 100644 (file)
@@ -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))