82536: catch null blocks from qbread
authorBarret Rhoden <brho@cs.berkeley.edu>
Mon, 29 Sep 2014 04:35:18 +0000 (21:35 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 29 Sep 2014 04:35:18 +0000 (21:35 -0700)
This shouldn't happen, since we don't tear down interfaces or anything
like that.

kern/drivers/net/ether82563.c

index 59d1da6..5395e5e 100644 (file)
@@ -1058,6 +1058,12 @@ static void i82563tproc(void *v)
                        continue;
                }
                bp = qbread(edev->oq, 100000);
+               if (!bp) {
+                       /* this only happens if the q is closed.  qbread can also throw,
+                        * btw, which we don't handle. */
+                       warn("i350 tproc failed to get a block, aborting!");
+                       return;
+               }
                td = &ctlr->tdba[tdt];
                td->addr[0] = paddr_low32(bp->rp);
                td->addr[1] = paddr_high32(bp->rp);