diff options
author | Jia-Ju Bai <baijiaju1990@gmail.com> | 2019-07-29 10:44:51 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-07-30 18:49:46 +0200 |
commit | e82f04ec6ba91065fd33a6201ffd7cab840e1475 (patch) | |
tree | aa9866fe8914b1645e4e38a5b9b74b301d0f3ee9 /drivers/scsi/hpsa.c | |
parent | scsi: mpt3sas: Use 63-bit DMA addressing on SAS35 HBA (diff) | |
download | linux-e82f04ec6ba91065fd33a6201ffd7cab840e1475.tar.xz linux-e82f04ec6ba91065fd33a6201ffd7cab840e1475.zip |
scsi: qla2xxx: Fix possible fcport null-pointer dereferences
In qla2x00_alloc_fcport(), fcport is assigned to NULL in the error
handling code on line 4880:
fcport = NULL;
Then fcport is used on lines 4883-4886:
INIT_WORK(&fcport->del_work, qla24xx_delete_sess_fn);
INIT_WORK(&fcport->reg_work, qla_register_fcport_fn);
INIT_LIST_HEAD(&fcport->gnl_entry);
INIT_LIST_HEAD(&fcport->list);
Thus, possible null-pointer dereferences may occur.
To fix these bugs, qla2x00_alloc_fcport() directly returns NULL
in the error handling code.
These bugs are found by a static analysis tool STCheck written by us.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/hpsa.c')
0 files changed, 0 insertions, 0 deletions