From 6329fe5c4e61655bcb8456805d2c485f791b50cc Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Sat, 5 Jul 2014 15:14:30 +0100 Subject: defxx: Discard DMA maps on buffer deallocation Prearranged receive DMA bounce buffer mappings are not released in the card reboot/shutdown path. That does not affect frame reception, but probably explains the random segmentation fault I observed the other day on interface shutdown. Card is rebooted as required by the spec in the process of ring fault recovery when a PC Trace signal has been received. This change fixes the problem in an obvious manner. Reported-by: Robert Coerver Tested-by: Robert Coerver Signed-off-by: Maciej W. Rozycki Signed-off-by: David S. Miller --- drivers/net/fddi/defxx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'drivers/net/fddi') diff --git a/drivers/net/fddi/defxx.c b/drivers/net/fddi/defxx.c index 4dcfb32983d9..0b2e80940b95 100644 --- a/drivers/net/fddi/defxx.c +++ b/drivers/net/fddi/defxx.c @@ -3447,8 +3447,13 @@ static void dfx_rcv_flush( DFX_board_t *bp ) { struct sk_buff *skb; skb = (struct sk_buff *)bp->p_rcv_buff_va[i+j]; - if (skb) + if (skb) { + dma_unmap_single(bp->bus_dev, + bp->descr_block_virt->rcv_data[i+j].long_1, + PI_RCV_DATA_K_SIZE_MAX, + DMA_FROM_DEVICE); dev_kfree_skb(skb); + } bp->p_rcv_buff_va[i+j] = NULL; } -- cgit v1.2.3