Purge a linked list

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

 



Hello all,

I am trying to use the standard structure list_head for linked lists
in the kernel. So far, I can search and add items to my linked list.
I can remove items from my linked list.

But when I want to purge the entire linked list. I get a kernel oops.
Does anyone have any suggestions? Any help is highly appreciated!

Thanks,
Ron

struct frule {
	int data;
	struct list_head list;
};

static void release_frules(struct frule *frs)
{
	struct frule *fr;
	struct list_head *p;

	list_for_each(p, frs) {
		fr = list_entry(p, struct frule, list);
		list_del(p);
		kfree(fr);
	}

	return;
}

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at 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