lkml.org 
[lkml]   [2000]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: kernel/dma.c question
On Tue, 26 Sep 2000, boria wrote:

> Hi,
>
> First of all, i am new to kernel, so please correct me if i am wrong or
> explain if i don't get something.
> Why does free_dma get declared with different return types in dma.c ?
>

So runtime checks don't have to be made. If you don't have DMA, the
functions just return -EINVAL (so they must return a value). Otherwise,
they don't return a value because they 'printk' their own diagnostic
message.

>
> Why does get_dma_list blindly write to a buffer (kernel/dma.c line 73) ?
> Is there some way to protect oneself from buffer overflows in kernel
> (some memory checking function) ?

It does not 'blindly' write. The kernel has allocated a whole page as
a buffer. See ../linux/fs/proc/array.c, line 1517. This is only called
by kernel code that has already allocated a buffer so no checking is
necessary.


Cheers,
Dick Johnson

Penguin : Linux version 2.2.15 on an i686 machine (797.90 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.


-
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:45    [W:0.036 / U:0.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site