just one clerification

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi


why we can't have static memory (arrays) in kernel function , kernel crashes if i use, i fixed it by dynamically allocating the memory

some glabal variables were used by the system call ,
this a bug that for some times function was not running properly , mostly first time function was not working properly,

how to allocate 2d array in the kernel code ,

i allocated 4*256 array of unsigned long as

ptr = (unsigned long**)kmalloc(4*256*sizeof(unsigned long),GFP_KERNEL);

is it correct

plz comment
Rajaram






R@j@r@m
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux