usb: diag_bridge: call bridge callbacks even for -EPROTO
The diagfwd_hsic driver acts as a client of the bridge and must
have its read/write callbacks called so it can properly free its
memory buffers. In the case of the HSIC device being disconnected,
the URB status is -EPROTO but the callback was withheld, which
led to lost buffers when the HSIC device is disconnected. Fix this
by always calling the callbacks, while continuing to treat -EPROTO
as a special case by returning -ENODEV on subsequent reads and
writes. Also fix a major but tiny gotcha in diagfwd's read function
in which the 'err' variable is additionally declared and used in a
local scope but is read outside it.
CRs-fixed: 394401
Change-Id: I2d4f7a2cf1caa5565d4131890fa39181aee8e4a2
Signed-off-by:
Jack Pham <jackp@codeaurora.org>
Loading
Please register or sign in to comment