CHROMIUM: gobi: revalidate existence of client after reacquiring lock

There is a potential race condition in read_sync() and client_free() in
qmidevice.c where the client struct may be freed while read_sync() /
client_free() temporarily releases the client lock, and then accesses
the client struct without revalidating it. This patch addresses the
issue by revalidating the existence of client after reacquiring the
lock.

BUG=chrome-os-partner:21124
TEST=Run suspend/resume stress test on a system with Gobi 3000 modem.

Change-Id: Iacb3027e6459a57e38c55bf5b603e1e4f8dfaa33
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62586
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
1 file changed