CHROMIUM: gobi: Introduce refcounted buffers.
authorElly Jones <ellyjones@chromium.org>
Mon, 16 May 2011 16:54:56 +0000 (12:54 -0400)
committerGrant Grundler <grundler@google.com>
Thu, 31 May 2012 20:19:12 +0000 (13:19 -0700)
commit5b97ade05801d84009184f9d82a03fb47cbf60fa
tree4939937401d3395d62d5dcfb26aa5407ae30942a
parent725266d37e80358a515ae76c9af122aa02ce1666
CHROMIUM: gobi: Introduce refcounted buffers.

This prevents a use-after-free of URB content buffers that was added in
802a2d60b5a5859abf78c1289e24ce2e6a560255. The root cause for this failure was
that I changed the invariant required for a buffer (i.e., I required the buffer
to live past function exit) without changing the call sites. I have introduced a
reference-counted buffer type which we use to make sure the buffer lives until
the urb layer is done with it.

This has the pleasant side-effect of killing a lot of variables.

BUG=chromium-os:15346
TEST=network_GobiUncleanDisconnect

Change-Id: I322dea4c4022b381616b13de75b49f82e9f5cd05
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/933
Reviewed-by: Olof Johansson <olofj@chromium.org>
drivers/net/usb/gobi/Makefile
drivers/net/usb/gobi/buffer.c [new file with mode: 0644]
drivers/net/usb/gobi/buffer.h [new file with mode: 0644]
drivers/net/usb/gobi/qmi.c
drivers/net/usb/gobi/qmi.h
drivers/net/usb/gobi/qmidevice.c