Jia-Ju Bai e82f04ec6b 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>
2019-07-30 12:49:46 -04:00
..
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2019-07-20 10:04:58 -07:00
2019-07-20 10:04:58 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:17:41 -07:00
2019-07-20 10:04:58 -07:00
2019-03-02 11:39:54 -08:00
2019-07-11 15:17:41 -07:00
2019-07-11 15:17:41 -07:00
2018-06-19 22:02:25 -04:00
2018-12-18 23:19:21 -05:00
2019-07-11 15:17:41 -07:00
2019-06-18 19:46:23 -04:00
2019-01-08 21:58:35 -05:00
2019-01-08 21:58:35 -05:00
2019-07-20 10:04:58 -07:00
2019-07-11 15:14:01 -07:00
2019-06-18 19:46:18 -04:00
2019-07-11 15:17:41 -07:00
2019-07-11 15:17:41 -07:00
2018-12-18 23:19:21 -05:00
2018-11-06 21:31:28 -05:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:17:41 -07:00
2018-12-28 14:48:06 -08:00
2019-05-20 10:56:43 -04:00
2019-07-11 15:17:41 -07:00
2019-07-11 15:17:41 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2018-06-19 22:02:25 -04:00
2019-07-20 10:04:58 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2018-12-18 23:19:21 -05:00
2019-05-21 06:16:23 -04:00
2019-07-11 15:14:01 -07:00
2019-07-20 10:04:58 -07:00
2019-07-11 15:17:41 -07:00
2019-07-11 15:17:41 -07:00
2019-07-11 15:14:01 -07:00