vhost: do not GSO when no header is present
authorEmmanuel Roullit <emmanuel.roullit@gmail.com>
Tue, 24 Jan 2017 20:36:03 +0000 (21:36 +0100)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Mon, 30 Jan 2017 12:46:57 +0000 (13:46 +0100)
commit5c1f70daafbca24fe10dc21afe44320e323d2f8f
treeb645dec8a4f96f9fa8f2ac115ad333315214d885
parent1e9057a97b3d5045f17412f19a9dc578a8067cc9
vhost: do not GSO when no header is present

Found with clang static analysis:
lib/librte_vhost/virtio_net.c:723:17: warning:
Access to field 'data_off' results in a dereference of a null pointer
(loaded from variable 'tcp_hdr')
        m->l4_len = (tcp_hdr->data_off & 0xf0) >> 2;
                     ^~~~~~~~~~~~~~~~~

Fixes: d0cf91303d73 ("vhost: add Tx offload capabilities")
Cc: stable@dpdk.org
Signed-off-by: Emmanuel Roullit <emmanuel.roullit@gmail.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
lib/librte_vhost/virtio_net.c