lkml.org 
[lkml]   [2020]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] net: mvneta: fix double free of txq->buf
From
From: trix@redhat.com
Date: Sat, 3 Oct 2020 11:51:21 -0700

> From: Tom Rix <trix@redhat.com>
>
> clang static analysis reports this problem:
>
> drivers/net/ethernet/marvell/mvneta.c:3465:2: warning:
> Attempt to free released memory
> kfree(txq->buf);
> ^~~~~~~~~~~~~~~
>
> When mvneta_txq_sw_init() fails to alloc txq->tso_hdrs,
> it frees without poisoning txq->buf. The error is caught
> in the mvneta_setup_txqs() caller which handles the error
> by cleaning up all of the txqs with a call to
> mvneta_txq_sw_deinit which also frees txq->buf.
>
> Since mvneta_txq_sw_deinit is a general cleaner, all of the
> partial cleaning in mvneta_txq_sw_deinit()'s error handling
> is not needed.
>
> Fixes: 2adb719d74f6 ("net: mvneta: Implement software TSO")
> Signed-off-by: Tom Rix <trix@redhat.com>

Applied and queued up for -stable, thank you.

\
 
 \ /
  Last update: 2020-10-05 00:11    [W:0.051 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site