mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 12:03:54 +02:00
Dan Carpenter's static checker reported:
drivers/ntb/ntb_transport.c:1926 ntb_transport_create_queue()
error: we previously assumed 'qp->tx_dma_chan' could be null (see line 1872)
This is because the tx_mw_dma_addr is uninitialized in this function and
may be incorrectly released using a NULL DMA channel.
In practice this bug will not likely be seen. I'd guess you could hit
this if you loaded ntb_netdev with use_dma=True, then unloaded it and
loaded it again after setting the module parameter to use_dma=False.
To fix this, we simply ensure that tx_mw_dma_addr is always
initialized to zero. This is the safest in case any other part of the
code operates on it if it is non-zero.
Fixes:
|
||
|---|---|---|
| .. | ||
| hw | ||
| test | ||
| Kconfig | ||
| Makefile | ||
| ntb_transport.c | ||
| ntb.c | ||