Commit 5ec63fd
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: aba3a8d ("usb: gadget: u_serial: add suspend resume callbacks")
Cc: stable <stable@kernel.org>
Signed-off-by: Prashanth K <quic_prashk@quicinc.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/1676309438-14922-1-git-send-email-quic_prashk@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 7ebb605 commit 5ec63fd
1 file changed
Lines changed: 19 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
85 | 88 | | |
86 | 89 | | |
87 | 90 | | |
| |||
1375 | 1378 | | |
1376 | 1379 | | |
1377 | 1380 | | |
| 1381 | + | |
| 1382 | + | |
1378 | 1383 | | |
1379 | | - | |
| 1384 | + | |
1380 | 1385 | | |
1381 | 1386 | | |
1382 | 1387 | | |
| |||
1391 | 1396 | | |
1392 | 1397 | | |
1393 | 1398 | | |
1394 | | - | |
| 1399 | + | |
| 1400 | + | |
1395 | 1401 | | |
1396 | 1402 | | |
1397 | 1403 | | |
| |||
1425 | 1431 | | |
1426 | 1432 | | |
1427 | 1433 | | |
1428 | | - | |
| 1434 | + | |
1429 | 1435 | | |
1430 | 1436 | | |
1431 | | - | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
1432 | 1447 | | |
1433 | 1448 | | |
1434 | 1449 | | |
| |||
0 commit comments