USB: u_bam: Avoid NULL pointer dereference in gbam_connect_work
In gbam_connect_work the port_usb may be NULL
as this might have been freed from gbam_free_requests
as part of gbam_disconnect. This is because
gbam_connect and rmnet_disable can run in parallel.
When back to back rmnet connect and disconnect happens,
this issue occurs.
Protect NULL pointer dereference by adding a NULL
check for port_usb. This pointer is already protected
under spinlock.
Also, if gbam_start_io fails for rx requests allocation
then free the tx requests, not the rx.
CRs-Fixed: 647073
Change-Id: I9d3a15ab2523d30365ac7ab8ce021fe513269b32
Signed-off-by:
Sujeet Kumar <ksujeet@codeaurora.org>
Loading
Please register or sign in to comment