Re: [PATCH] sys_select() kmallocs 0 bytes.

From: Dave Jones (dave@denial.force9.co.uk)
Date: Thu May 25 2000 - 16:31:11 EST


Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> > ret = -EINVAL;
> > - if (n < 0)
> > + if (n <= 0)
> > goto out_nofds;
>
> This is incorrect. In fact the zero kmalloc if anything is harmless. A
> 0 fd select is legal and used for timers

Can you elaborate on this? I'm not disputing it, but I'd like to
understand what difference things make if the kmalloc isnt taken.

My understanding is that with the existing code, if n=0, we kmalloc 0
bytes, fail, and goto out_nofds. With my patch, if n=0, we goto out_nofds.
(Or am I missing something obvious here?)

The 'We ought to optimise the n=0 case - it is used enough.'
kind of made me scratch my head a little too..

-- 
Dave.

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



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:15 EST