From: David Miller <davem@davemloft.net>
To: trix@redhat.com
Cc: thomas.petazzoni@bootlin.com, kuba@kernel.org,
natechancellor@gmail.com, ndesaulniers@google.com,
ezequiel.garcia@free-electrons.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com
Subject: Re: [PATCH] net: mvneta: fix double free of txq->buf
Date: Sun, 04 Oct 2020 15:08:31 -0700 (PDT) [thread overview]
Message-ID: <20201004.150831.1030602377050100130.davem@davemloft.net> (raw)
In-Reply-To: <20201003185121.12370-1-trix@redhat.com>
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.
prev parent reply other threads:[~2020-10-04 22:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-03 18:51 [PATCH] net: mvneta: fix double free of txq->buf trix
2020-10-04 22:08 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201004.150831.1030602377050100130.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=clang-built-linux@googlegroups.com \
--cc=ezequiel.garcia@free-electrons.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=natechancellor@gmail.com \
--cc=ndesaulniers@google.com \
--cc=netdev@vger.kernel.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=trix@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).