On Monday 13 August 2012 23:00:25 John Baldwin wrote:
> int
> foo_attach(device_t dev)
> {
>         struct foo_softc *sc;
> 
>         sc = malloc(sizeof(struct foo_softc), M_BUS, M_WAITOK | M_ZERO);
>         device_set_softc(dev, sc);
>         ...

Hi,

Here you forget that there are alot of else/if's that need free(sc, M_BUS) for 
various failing cases! That's why I say +5 lines.

BTW: If we do add device_free_softc, would it be an idea to add 
device_alloc_softc aswell, to make stuff more clear for the drivers?

--HPS
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to