On Fri, 27 Oct 2006, Linus Torvalds wrote: > > static int do_in_parallel(void *arg) > { > struct thread_exec *p = arg; > int (*fn)(void *) = p->fn; > void *arg = p->arg; > int retval; > > /* Tell the caller we are done with the arguments */ > complete(&p->completion); > > /* Do the actual work in parallel */ > retval = p->fn(p->arg); Duh. The whole reason I copied them was to _not_ do that. That last line should obviously be retval = fn(arg); because "p" may gone after we've done the "complete()". > (And I repeat: the above code is untested, and was written in the email > client. It has never seen a compiler, and not gotten a _whole_ lot of > thinking). .. This hasn't changed, I just looked through the code once and found that obvious bug. Linus - 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/
- Follow-Ups:
- References:
- Linux 2.6.19-rc3
- From: Linus Torvalds <[email protected]>
- 2.6.19-rc3: known unfixed regressions (v2)
- From: Adrian Bunk <[email protected]>
- [RFC: 2.6.19 patch] let PCI_MULTITHREAD_PROBE depend on BROKEN
- From: Adrian Bunk <[email protected]>
- Re: [RFC: 2.6.19 patch] let PCI_MULTITHREAD_PROBE depend on BROKEN
- From: Matthew Wilcox <[email protected]>
- Re: [RFC: 2.6.19 patch] let PCI_MULTITHREAD_PROBE depend on BROKEN
- From: Andrew Morton <[email protected]>
- Re: [RFC: 2.6.19 patch] let PCI_MULTITHREAD_PROBE depend on BROKEN
- From: Stephen Hemminger <[email protected]>
- Re: [RFC: 2.6.19 patch] let PCI_MULTITHREAD_PROBE depend on BROKEN
- From: Greg KH <[email protected]>
- Re: [RFC: 2.6.19 patch] let PCI_MULTITHREAD_PROBE depend on BROKEN
- From: Pavel Machek <[email protected]>
- Re: [RFC: 2.6.19 patch] let PCI_MULTITHREAD_PROBE depend on BROKEN
- From: Andrew Morton <[email protected]>
- vmlinux.lds: consolidate initcall sections
- From: Andrew Morton <[email protected]>
- [patch] drivers: wait for threaded probes between initcall levels
- From: Andrew Morton <[email protected]>
- Re: [patch] drivers: wait for threaded probes between initcall levels
- From: Stephen Hemminger <[email protected]>
- Re: [patch] drivers: wait for threaded probes between initcall levels
- From: Andrew Morton <[email protected]>
- Re: [patch] drivers: wait for threaded probes between initcall levels
- From: Linus Torvalds <[email protected]>
- Linux 2.6.19-rc3
- Prev by Date: Re: [patch] drivers: wait for threaded probes between initcall levels
- Next by Date: Re: [PATCH 1/1] fat: improve sync performance by grouping writes in fat_mirror_bhs [really unmangled]
- Previous by thread: Re: [patch] drivers: wait for threaded probes between initcall levels
- Next by thread: Re: [patch] drivers: wait for threaded probes between initcall levels
- Index(es):