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 Signed-off-by: Jack Pham <jackp@codeaurora.org> Conflicts: drivers/usb/misc/diag_bridge.c Change-Id: Ic40e43555ba557ac0caf3abfd3b8e372eb522003 Signed-off-by: Neha Pandey <nehap@codeaurora.org>