Re: Freeing work_struct memory

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

 



Hi ...

On Tue, Nov 22, 2011 at 03:55, Kai Meyer <kai@xxxxxxxxxx> wrote:
> I frequently get a kernel panic with a specific test, but the stack
> trace is rarely the same, which seems to indicate to me that I'm
> corrupting data somewhere. So my question is:
>
> Can I free the memory for "struct my_worker *worker" inside worker_fn?
> Or does the work_queue stuff need to continue to use the "struct
> work_struct work" member after the end of worker_fn?

I think it's due to the dequeueing out of the worker thread. So, it
tries to dequeue, but in fact it points to NULL.

You need to make sure it finishes completely first...then free it later.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[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