lkml.org 
[lkml]   [2001]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch] 2.4.0: defxx oopses upon insmod if short on memory
Date
From
> @@ -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/

\
 
 \ /
  Last update: 2005-03-22 12:52    [W:0.021 / U:1.160 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site