free(sc, M_DEVBUF) [Was: amd64 panic snd_hda - hdac_get_capabilities: Invalid corb size (0)]

Andriy Gapon avg at icyb.net.ua
Wed Jul 28 17:09:29 UTC 2010


on 28/07/2010 19:59 Pyun YongHyeon said the following:
> 
> When I started to write snd_audiocs(4) for sparc64 I also noticed
> that. The practice of sound driver was to explicitly allocate softc
> structure in device attach routine and release it after use. I
> don't remember details but other parts of sound subsystem seemed to
> rely on the structure and changing it to use standard
> device_get_softc(9) was not easy task.

Oh, I see what you mean.
So those drivers do malloc their softc.
snd_hda was (is) the only one that got it via device_get_softc, but still used
free(9) on it in the case of attachment failure.

-- 
Andriy Gapon


More information about the freebsd-current mailing list