]> git.karo-electronics.de Git - karo-tx-linux.git/commit
macvtap: zerocopy: set SKBTX_DEV_ZEROCOPY only when skb is built successfully
authorJason Wang <jasowang@redhat.com>
Wed, 2 May 2012 03:42:06 +0000 (11:42 +0800)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 25 Jul 2012 03:11:04 +0000 (04:11 +0100)
commitcc64214d05941d09bb9f80051a1949a7223b8ab7
treec9d42c709002c16c77fee9ae0f2d6f9c7b6fd22e
parente9214638ead441c15b48f40c3b459aede77c2662
macvtap: zerocopy: set SKBTX_DEV_ZEROCOPY only when skb is built successfully

commit 01d6657b388438def19c8baaea28e742b6ed32ec upstream.

Current the SKBTX_DEV_ZEROCOPY is set unconditionally after
zerocopy_sg_from_iovec(), this would lead NULL pointer when macvtap
fails to build zerocopy skb because destructor_arg was not
initialized. Solve this by set this flag after the skb were built
successfully.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/macvtap.c