RE: Error in creating a slab cache.

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

 



Hi,
I have been trying to write a module that creates a slab cache and then add some objects to it through /proc/testing_slab and then trying to delete them and destroy the cache while unloading the module.
I am having trouble using the list_* group of API's
I have used current_object as a global variable but its not retaining the value when used in another function and even the list that had been made using the list_add() is showing junk values.
and when i am trying to unload it, it causes a kernel oops.


I am attaching the code and Makefile along with this mail.
Please advice.

Thanks and Regards,
Naren


HI, The problem is that you are using uninitialised memory.

You must first allocate. use kalloc();
you have used:
struct list_head *p;
 struct test_slab *tmp;

global test_slab s seem to be allocated nowhere.

and other places too.

and another suggestion dont use such large arrays as local variable in kernel modules.
The kernel stack is scarce (8k and 4k in x86). so use kmalloc.
you have.
char my_buffer[180];
char mesg_ins[80];
char mesg_del[80];


regsrds manish

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus



-- 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