CHROMIUM: gobi: fix use-after-free of setup buffer.
The buffer might outlive the function if semaphores are broken (i.e., if we have
a pending signal), so stick it in the refcounted context so it only gets cleaned
up when we're done with it.
Additionally, fix some double-frees in error cleanup paths, and document a bit.
BUG=chromium-os:15017
TEST=network_GobiUncleanDisconnect
Change-Id: Ie58a912c1d7c9eba87a0516970a63347150676a1
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/3686
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: ttuttle <ttuttle@chromium.org>