• Bart Van Assche's avatar
    [SCSI] qla2xxx: Fix a memory leak in an error path of qla2x00_process_els() · 8c0eb596
    Bart Van Assche authored
    Avoid that the fcport structure gets leaked if
    bsg_job->request->msgcode == FC_BSG_HST_ELS_NOLOGIN, the fcport
    allocation succeeds and the !vha->flags.online branch is taken.
    This was detected by Coverity. However, Coverity does not recognize
    that all qla2x00_process_els() callers specify either
    FC_BSG_RPT_ELS or FC_BSG_HST_ELS_NOLOGIN in the field
    bsg_job->request->msgcode and that the value of that field is not
    modified inside that function. This results in a false positive
    report about a possible memory leak in an error path for
    bsg_job->request->msgcode values other than the two mentioned
    values.  Make it easy for Coverity (and for humans) to recognize
    that there is no fcport leak in the error path by changing the
    bsg_job->request->msgcode == FC_BSG_HST_ELS_NOLOGIN test into
    bsg_job->request->msgcode != FC_BSG_RPT_ELS.
    Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
    Signed-off-by: default avatarSaurav Kashyap <saurav.kashyap@qlogic.com>
    Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
    8c0eb596
qla_bsg.c 57.3 KB