Loading
usb: gadget: u_ether: Add NULL check for link->in_ep and link->out_ep
gether_connect() API checks link->in_ep and link->out_ep against NULL
but missing as part of error handling. Below are possible NULL pointer
dereference situations:
1. If there is no link->in_ep endpoint and enabling of link->out_ep
fails, link->in_ep endpoint is accessed without checking it against NULL
as part of error handling.
2. If alloc_requests() returns non-zero value (i.e. result variable
becomes non-zero), then both link->in_ep and link->out_ep endpoints are
accessed without checking it against NULL.
Fix above issues by adding NULL check against link->in_ep and link->out_ep
endpoints.
CRs-Fixed: 1056034
Change-Id: Icaa9d12a6414b895984e874ddeb12992e622fb56
Signed-off-by:
Mayank Rana <mrana@codeaurora.org>