Subject: Re: no callout_stop? Re: callout_init ...
To: None <tech-kern@NetBSD.org>
From: Chapman Flack <nblists@anastigmatix.net>
List: tech-kern
Date: 01/04/2006 18:23:29
Manuel Bouyer wrote:
> It's luck. callouts needs to be stopped and freed explicitely before
> the pointer passed to the callback is freed.

Ah, kinda what I was thinking. I'm in the process of churning
out patches to midi right now, so I'll include that.  The callout
struct doesn't need freed (it's inlined in midi_softc) but should
definitely be stopped.  Is that usually done in the handler for
activate/deactivate or for detach?

Any thoughts on my earlier question about the placement of
callout_init?  That seems to be luck too ... I checked and
saw that callout_init happens to be memset(...0...), and that
config_attach happens to memset(...0...) the whole softc after
malloc'ing it, and I'd bet that's the only reason midi_pcppi
doesn't crash. I wonder how many interesting things would get
found if config_attach were changed to do memset(...0x5a...) ;)

-Chap