Thread (5 messages) 5 messages, 3 authors, 2013-12-26

Re: [PATCH stable 1/2] virtio_net: fix error handling for mergeable buffers

flat view

From: Michael S. Tsirkin <mst@redhat.com>
Date: 2013-12-25 19:15:44
Also in: lkml, netdev

On Wed, Dec 25, 2013 at 10:33:37AM -0800, Michael Dalton wrote:
Hi Michael, quick question below:

On Wed, Dec 25, 2013 at 6:56 AM, Michael S. Tsirkin [off-list ref] wrote:
quoted
                if (i >= MAX_SKB_FRAGS) {
                        pr_debug("%s: packet too long\n", skb->dev->name);
                        skb->dev->stats.rx_length_errors++;
-                       return -EINVAL;
+                       return NULL;
                }
Should this error handling path free the SKB before returning NULL?
It seems like if we just return NULL we may leak memory.

Best,

Mike
It's a device error, but
I agree, if we touch this code anyway there's no reason not to handle
this consistently and do goto toward end of file.
It's not a backport anymore though - this code is gone upstream,
so I'll make it a separate patch I think.

-- 
MST
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help