Commit 6a8037d4 authored by Prashanth K's avatar Prashanth K
Browse files

UPSTREAM: usb: gadget: u_serial: Add null pointer check in gserial_resume



Consider a case where gserial_disconnect has already cleared
gser->ioport. And if a wakeup interrupt triggers afterwards,
gserial_resume gets called, which will lead to accessing of
gser->ioport and thus causing null pointer dereference.Add
a null pointer check to prevent this.

Added a static spinlock to prevent gser->ioport from becoming
null after the newly added check.

Fixes: aba3a8d0 ("usb: gadget: u_serial: add suspend resume callbacks")
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarPrashanth K <quic_prashk@quicinc.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/1676309438-14922-1-git-send-email-quic_prashk@quicinc.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 270271430
(cherry picked from commit 5ec63fdb
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/

 usb-next)

Change-Id: Ib54ccfc7921fd399d538d93d13d6fe8beef0fb39
Signed-off-by: default avatarPrashanth K <quic_prashk@quicinc.com>
parent f0be4b97
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment