mirror of
https://github.com/ipxe/ipxe
synced 2025-12-30 13:11:11 +03:00
[netdevice] Do not attempt to unmap a null I/O buffer
netdev_tx_err() may be called with a null I/O buffer (e.g. to record a transmit error with no associated buffer). Avoid a potential null pointer dereference in the DMA unmapping code path. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -392,7 +392,7 @@ void netdev_tx_err ( struct net_device *netdev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Unmap I/O buffer, if required */
|
/* Unmap I/O buffer, if required */
|
||||||
if ( dma_mapped ( &iobuf->map ) )
|
if ( iobuf && dma_mapped ( &iobuf->map ) )
|
||||||
iob_unmap ( iobuf );
|
iob_unmap ( iobuf );
|
||||||
|
|
||||||
/* Discard packet */
|
/* Discard packet */
|
||||||
|
|||||||
Reference in New Issue
Block a user