usb: diag: Avoid NULL pointer dereference in debugfs
The debugfs entry functions used to read and clear the statistics
counters loop over the list of open diag channels. However, a
channel might not be bound to a gadget interface if diag_function_add
doesn't get called, hence its priv_usb member may be NULL. In that
case simply avoid accessing it altogether as its counters aren't used
anyway.
CRs-fixed: 346598
Change-Id: Icbd84ae0df83a5fe4c62b19fd7c95585e8e6e491
Signed-off-by: Jack Pham <jackp@codeaurora.org>
1 file changed