Commit d54820b
scsi: qla2xxx: Fix NULL pointer dereference in target mode
When target mode is enabled, the pci_irq_get_affinity() function may return
a NULL value in qla_mapq_init_qp_cpu_map() due to the qla24xx_enable_msix()
code that handles IRQ settings for target mode. This leads to a crash due
to a NULL pointer dereference.
This patch fixes the issue by adding a check for the NULL value returned by
pci_irq_get_affinity() and introducing a 'cpu_mapped' boolean flag to the
qla_qpair structure, ensuring that the qpair's CPU affinity is updated when
it has not been mapped to a CPU.
Fixes: 1d201c8 ("scsi: qla2xxx: Select qpair depending on which CPU post_cmd() gets called")
Signed-off-by: Gleb Chesnokov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Himanshu Madhani <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>1 parent 2a737d3 commit d54820b
File tree
4 files changed
+10
-0
lines changed- drivers/scsi/qla2xxx
4 files changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3796 | 3796 | | |
3797 | 3797 | | |
3798 | 3798 | | |
| 3799 | + | |
3799 | 3800 | | |
3800 | 3801 | | |
3801 | 3802 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9426 | 9426 | | |
9427 | 9427 | | |
9428 | 9428 | | |
| 9429 | + | |
| 9430 | + | |
| 9431 | + | |
9429 | 9432 | | |
9430 | 9433 | | |
9431 | 9434 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
539 | 539 | | |
540 | 540 | | |
541 | 541 | | |
| 542 | + | |
| 543 | + | |
542 | 544 | | |
543 | 545 | | |
544 | 546 | | |
545 | 547 | | |
546 | 548 | | |
| 549 | + | |
547 | 550 | | |
548 | 551 | | |
549 | 552 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3770 | 3770 | | |
3771 | 3771 | | |
3772 | 3772 | | |
| 3773 | + | |
| 3774 | + | |
| 3775 | + | |
3773 | 3776 | | |
3774 | 3777 | | |
3775 | 3778 | | |
| |||
0 commit comments