Re: list.h - how to remove all the entries from the list

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

 



On Sun, 24 Oct 2004 12:38:11 -0300 (ART)
Mauricio Lin <mauriciolin2000@xxxxxxxxxxxx> wrote:

> Hi all,
> 
> I have tried to use some functions from list.h.
> Below is the snippet of the code:
> 
> list_for_each(tmp, &pidqueue_head) {
>    candidate = list_entry(tmp, struct
> candidate_process, pid_list);
>    list_del(&candidate->pid_list);
> }
> 
> I am using this in a module, so this is executed when
> I remove the module using rmmod module.ko and the
> segmentation fault is printed on my screen.
> 
> After the first element is removed from the list the
> following error is printed on my log file:
> "Unable to handle kernel paging request at virtual
> address 00100100."

Look at the definition of list_del() in include/linux/list.h.
Use list_for_each_safe() instead.

Bye,
feketga

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