patch-2.4.21 linux-2.4.21/drivers/net/3c505.c

Next file: linux-2.4.21/drivers/net/3c507.c
Previous file: linux-2.4.21/drivers/net/3c501.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/drivers/net/3c505.c linux-2.4.21/drivers/net/3c505.c
@@ -1036,8 +1036,9 @@
 	adapter->current_dma.direction = 1;
 	adapter->current_dma.start_time = jiffies;
 
-	if ((unsigned long)(skb->data + nlen) >= MAX_DMA_ADDRESS) {
-		memcpy(adapter->dma_buffer, skb->data, nlen);
+	if ((unsigned long)(skb->data + nlen) >= MAX_DMA_ADDRESS || nlen != skb->len) {
+		memcpy(adapter->dma_buffer, skb->data, skb->len);
+		memset(adapter->dma_buffer+skb->len, 0, nlen-skb->len);
 		target = virt_to_bus(adapter->dma_buffer);
 	}
 	else {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)