> What about doing both allocations in succession to local variables, > share the failure path if an error occours an kfree them unconditionally > like this? > > new_node = kmalloc(sizeof(struct mpath_node), GFP_KERNEL); > new_mpath = kzalloc(sizeof(struct mesh_path), GFP_KERNEL); If the system is under enough pressure to fail the first allocation, do we really want to try another one just to free things again right away? I'm with Pavel here, let's rather clean up the failure code path. johannes
Attachment:
signature.asc
Description: This is a digitally signed message part