kernel newbie question on kernel panic

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <netdev@...>
Date: Monday, July 21, 2008 - 11:24 am

Hi all,

I try to create my first kernel module.
I have following problem. I have a function rp ... interesting part
follows (just some initialization is ommited - nothing special - the
function is just a skeleton)

int rp( struct sk_buff ** skb)
{
	_filter_rule * rule = NULL;

...

	rule = placebo();
-->	if( rule == NULL)
		printk( KERN_DEBUG "null rule\n");
	return 1;
}

The rp is called (subsequently) in netfilter (prerouting) hook context,
so as far as I know it runs in a SoftIRQ.

The placebo function does nothing - just returns NULL. The problem is in
line selected (-->).Everything goes until I try to somehow access
returned value. The access raises kernel panic, seems that some page
fault happent. If I comment out the line bellow selected (the test), no
kernel panic happens.

Questions are:
- why the page fault happens (some trouble in memory usage, or so?)
- how to avoid it?

Thanks for any help
Michal Filka
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
kernel newbie question on kernel panic, Filka Michal, (Mon Jul 21, 11:24 am)
Re: kernel newbie question on kernel panic, Daniel Lezcano, (Mon Jul 21, 12:07 pm)