Re: [patch] 2.4.0: defxx oopses upon insmod if short on memory

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Mon Jan 08 2001 - 15:15:59 EST


> @@ -2709,7 +2709,10 @@ static void dfx_rcv_init(DFX_board_t *bp
> struct sk_buff *newskb;
> bp->descr_block_virt->rcv_data[i+j].long_0 = (u32) (PI_RCV_DESCR_M_SOP |
> ((PI_RCV_DATA_K_SIZE_MAX / PI_ALIGN_K_RCV_DATA_BUFF) << PI_RCV_DESCR_V_SEG_LEN));
> - newskb = dev_alloc_skb(NEW_SKB_SIZE);
> + while (!(newskb = dev_alloc_skb(NEW_SKB_SIZE))) {
> + printk(KERN_WARNING "%s: Could not allocate receive buffer.\n", bp->dev->name);
> + schedule();
> + }

Wouldn't it be cleaner to malloc the new buffer and if that fails drop the
just received frame and reuse that skbuff?

schedule definitely isnt going to help

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jan 15 2001 - 21:00:18 EST