From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH stable 1/2] virtio_net: fix error handling for mergeable buffers Date: Wed, 25 Dec 2013 21:19:32 +0200 Message-ID: <20131225191932.GB22071@redhat.com> References: <1387983339-1172-1-git-send-email-mst@redhat.com> <1387983339-1172-2-git-send-email-mst@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lf-virt , Eric Dumazet , David Miller To: Michael Dalton Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org List-Id: netdev.vger.kernel.org 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 wrote: > > 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