> - Since mac_register_t must always be freed by the driver immediately  
 > after invoking mac_register(), could mac_register() itself free (i.e.  
 > consume) the structure directly? Then you could get rid of mac_free().

The mac_register_t would have to be freed by mac_register() even if it
fails for this to be useful.  I've always been uncomfortable with
functions that fail but still have caller-visible side effects --
minimally, the programming interface just feels awkward.  Further, suppose
there is a version mismatch (m_ident does not match) -- then how does
mac_register() know the size of the mac_register_t that was allocated by
mac_alloc() so that it can properly free it?  By having mac_alloc() store
the actual size that the driver allocated in the mac_register_t?

--
meem
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to