diff options
author | Tom Rix <trix@redhat.com> | 2020-10-03 11:51:21 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-10-04 15:07:19 -0700 |
commit | f4544e5361da5050ff5c0330ceea095cb5dbdd72 (patch) | |
tree | 6ce419440a2fbdceebe089c944e9d93cfcb890e7 /net/core/hwbm.c | |
parent | 580e4273d7a883ececfefa692c1f96bdbacb99b5 (diff) |
net: mvneta: fix double free of txq->buf
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/hwbm.c')
0 files changed, 0 insertions, 0 deletions