CHROMIUM: gobi: fix use-after-free of setup buffer.
authorElly Jones <ellyjones@chromium.org>
Wed, 6 Jul 2011 19:22:56 +0000 (15:22 -0400)
committerGrant Grundler <grundler@google.com>
Thu, 31 May 2012 20:19:17 +0000 (13:19 -0700)
commitaa23d218823919487197f98e81206727cc57d7a4
tree51d62a401766c176c40a420603abef72a220a6f7
parent6706afa23cd17f66b0bb425d5cd10781e0e2ad44
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>
drivers/net/usb/gobi/qmidevice.c