• Arnd Bergmann's avatar
    scsi: lpfc: fix remoteport access · f8d29432
    Arnd Bergmann authored
    The addition of a spinlock in lpfc_debugfs_nodelist_data() introduced
    a bug that lets us not skip NULL pointers correctly, as noticed by
    gcc-8:
    
    drivers/scsi/lpfc/lpfc_debugfs.c: In function 'lpfc_debugfs_nodelist_data.constprop':
    drivers/scsi/lpfc/lpfc_debugfs.c:728:13: error: 'nrport' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       if (nrport->port_role & FC_PORT_ROLE_NVME_INITIATOR)
    
    This changes the logic back to what it was, while keeping the added
    spinlock.
    
    Fixes: 9e210178 ("scsi: lpfc: Synchronize access to remoteport via rport")
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    f8d29432
lpfc_debugfs.c 171 KB