mirror of https://github.com/ipxe/ipxe.git
[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>pull/181/head
parent
8d337ecdae
commit
9ff61ab28d
|
@ -392,7 +392,7 @@ void netdev_tx_err ( struct net_device *netdev,
|
|||
}
|
||||
|
||||
/* Unmap I/O buffer, if required */
|
||||
if ( dma_mapped ( &iobuf->map ) )
|
||||
if ( iobuf && dma_mapped ( &iobuf->map ) )
|
||||
iob_unmap ( iobuf );
|
||||
|
||||
/* Discard packet */
|
||||
|
|
Loading…
Reference in New Issue