In RNDIS composition when windows PC is suspended RNDIS
driver sends flow control enable which frees the trb pool
of the RNDIS endpoints and trb pool pointer is set to NULL.
When bus suspend happens RNDIS gsi driver performs endpoint
disable operation because remote wake up is disabled. Endpoint
disable perform memset 0 on trb pool which is already set to
NULL causing the NULL pointer dereference. Fix this by adding
NULL check for trb pool before doing memset 0.
CRs-Fixed:
1044799
Change-Id: I2a233e85139be0612314e6fa3dfa1d1c0fa04547
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
* due to stale trbs with HWO bit set from previous composition when update
* transfer cmd is issued.
*/
- if (dep->number > 1) {
+ if (dep->number > 1 && dep->trb_pool) {
memset(&dep->trb_pool[0], 0,
sizeof(struct dwc3_trb) * dep->num_trbs);
dbg_event(dep->number, "Clr_TRB", 0);