spidernet: invalidate unused pointer.
authorLinas Vepstas <linas@austin.ibm.com>
Mon, 11 Jun 2007 18:52:03 +0000 (13:52 -0500)
committerJeff Garzik <jeff@garzik.org>
Mon, 9 Jul 2007 02:16:41 +0000 (22:16 -0400)
Invalidate a pointer as its pci_unmap'ed; this is a bit of
paranoia to make sure hardware doesn't continue trying to
DMA to it.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/spider_net.c

index 4d180072de4d7fff8b0708666b4154011de431ae..628efc01f273a80c8e12c3d2c5722d4b9d28986f 100644 (file)
@@ -1187,6 +1187,7 @@ spider_net_decode_one_descr(struct spider_net_card *card)
        struct spider_net_descr_chain *chain = &card->rx_chain;
        struct spider_net_descr *descr = chain->tail;
        struct spider_net_hw_descr *hwdescr = descr->hwdescr;
+       u32 hw_buf_addr;
        int status;
 
        status = spider_net_get_descr_status(hwdescr);
@@ -1200,7 +1201,9 @@ spider_net_decode_one_descr(struct spider_net_card *card)
        chain->tail = descr->next;
 
        /* unmap descriptor */
-       pci_unmap_single(card->pdev, hwdescr->buf_addr,
+       hw_buf_addr = hwdescr->buf_addr;
+       hwdescr->buf_addr = 0xffffffff;
+       pci_unmap_single(card->pdev, hw_buf_addr,
                        SPIDER_NET_MAX_FRAME, PCI_DMA_FROMDEVICE);
 
        if ( (status == SPIDER_NET_DESCR_RESPONSE_ERROR) ||
@@ -1235,7 +1238,7 @@ spider_net_decode_one_descr(struct spider_net_card *card)
        if (hwdescr->dmac_cmd_status & 0xfcf4) {
                dev_err(&card->netdev->dev, "bad status, cmd_status=x%08x\n",
                               hwdescr->dmac_cmd_status);
-               pr_err("buf_addr=x%08x\n", hwdescr->buf_addr);
+               pr_err("buf_addr=x%08x\n", hw_buf_addr);
                pr_err("buf_size=x%08x\n", hwdescr->buf_size);
                pr_err("next_descr_addr=x%08x\n", hwdescr->next_descr_addr);
                pr_err("result_size=x%08x\n", hwdescr->result_size);