Re: [V2 PATCH 4/9] macvtap: zerocopy: set SKBTX_DEV_ZEROCOPY only when skb is built successfully

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On 05/16/2012 01:44 AM, Shirley Ma wrote:
On Wed, 2012-05-02 at 11:42 +0800, Jason Wang wrote:
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.
I thought this flag was needed for zerocopy skb free even in err case.
I've checked it back again, it's OK to move the flag after the skb
successfully built. Or we can fix it by modify skb free with
destructor_arg NULL check as below:
...
skb_release_data() {
...
                 if (skb_shinfo(skb)->tx_flags&  SKBTX_DEV_ZEROCOPY) {
                         struct ubuf_info *uarg;

                         uarg = skb_shinfo(skb)->destructor_arg;
                         if (uarg&&  uarg->callback)
                                 uarg->callback(uarg);
                 }

...
}
Thanks
Shirley

Yes, both are ok. Since the code were merged, let's just use current method.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux Kernel Discussion]     [Ethernet Bridging]     [Linux Wireless Networking]     [Linux Bluetooth Networking]     [Linux Networking Users]     [VLAN]     [Git]     [IETF Annouce]     [Linux Assembly]     [Security]     [Bugtraq]     [Photo]     [Singles Social Networking]     [Yosemite Information]     [MIPS Linux]     [ARM Linux Kernel]     [ARM Linux]     [Linux Virtualization]     [Linux Security]     [Linux IDE]     [Linux RAID]     [Linux SCSI]     [Free Dating]

Add to Google Powered by Linux