usb: gadget: gsi: Fix error handling when memory allocation fails
gsi_ctrl_pkt_alloc() API may return ERR_PTR(-ENOMEM) if memory
allocation fails. gsi_ctrl_send_cpkt_tomodem() and
gsi_ctrl_dev_write() APIs are checking against NULL value only.
Hence make sure that list_add() operation is not performed with
unallocated cpkt. This change fixes NULL pointer dereference
with __list_add.
Change-Id: I449066ba4f257d3c9c1eae7da7d4d520d4793382
Signed-off-by:
Hemant Kumar <hemantk@codeaurora.org>
Loading
Please register or sign in to comment