scsi: bfa: Do not dereference port before it is null checked
authorColin Ian King <colin.king@canonical.com>
Tue, 30 Aug 2016 16:36:16 +0000 (17:36 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 2 Sep 2016 10:09:16 +0000 (06:09 -0400)
commit5f6ac2cee25cb0bf6ec07249a6180cabd46a1913
treead093643c03448ee582a80f3d460019d99326da5
parent02ccda2a2ffba8750dcebe13a09ce5f671ffcda6
scsi: bfa: Do not dereference port before it is null checked

Port is deferenced before it is null sanity checked, hence we
potentially have a null pointer dereference bug. Instead, initialise
trl_enabled from port->fcs->bfa after we are sure port is not null.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/bfa/bfa_fcs_lport.c