Commit f4544e5
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: 2adb719 ("net: mvneta: Implement software TSO")
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent 580e427 commit f4544e5
1 file changed
Lines changed: 2 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3400 | 3400 | | |
3401 | 3401 | | |
3402 | 3402 | | |
3403 | | - | |
3404 | | - | |
3405 | | - | |
3406 | | - | |
| 3403 | + | |
3407 | 3404 | | |
3408 | | - | |
3409 | 3405 | | |
3410 | 3406 | | |
3411 | 3407 | | |
3412 | 3408 | | |
3413 | 3409 | | |
3414 | | - | |
3415 | | - | |
3416 | | - | |
3417 | | - | |
3418 | | - | |
| 3410 | + | |
3419 | 3411 | | |
3420 | | - | |
3421 | 3412 | | |
3422 | 3413 | | |
3423 | 3414 | | |
| |||
0 commit comments