Re: segmentation fault while loading modules

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

 



> int
> ksignal(int pid,int signum)
> {
> struct task_struct x;
> struct task_struct *p;
> /* run through the task list of linux until we find our pid */
> //for (p = &init_task ; (p = next_task(p)) != &init_task ; ){
> for (p = &x ; (p = next_task(p)) != &x ; ){
...

next_task(p) is defined (not in the sense of a macro, though) as 
  p->tasks.next
and your x is not initiailzed, so what do you expect next_task(x)
to do, if p->tasks... does not contain a valid value?

You want this:
for(p = &init_task; (p = next_task(p)) != &init_task; ) {
    ...
}


Jan Engelhardt
-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux