Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc490d94 authored by Hemant Kumar's avatar Hemant Kumar
Browse files

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: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 184e2ced
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment