diff options
| author | Prashanth K <[email protected]> | 2023-05-05 09:18:37 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2023-05-29 14:22:43 +0000 |
| commit | 2f6ecb89fe8feb2b60a53325b0eeb9866d88909a (patch) | |
| tree | badb0c3ca10281bfc40a9477ea56584cd279aa71 /drivers/usb/cdns3/cdns3-starfive.c | |
| parent | dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add orientation-switch as opti... (diff) | |
| download | kernel-2f6ecb89fe8feb2b60a53325b0eeb9866d88909a.tar.gz kernel-2f6ecb89fe8feb2b60a53325b0eeb9866d88909a.zip | |
usb: gadget: u_serial: Add null pointer check in gserial_suspend
Consider a case where gserial_disconnect has already cleared
gser->ioport. And if gserial_suspend gets called afterwards,
it will lead to accessing of gser->ioport and thus causing
null pointer dereference.
Avoid this by adding a null pointer check. Added a static
spinlock to prevent gser->ioport from becoming null after
the newly added null pointer check.
Fixes: aba3a8d01d62 ("usb: gadget: u_serial: add suspend resume callbacks")
Signed-off-by: Prashanth K <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-starfive.c')
0 files changed, 0 insertions, 0 deletions
