Skip to content

Commit 7fb223d

Browse files
jgu-puremartinkpetersen
authored andcommitted
scsi: qla2xxx: Fix a memory leak in an error path of qla2x00_process_els()
Commit 8c0eb59 ("[SCSI] qla2xxx: Fix a memory leak in an error path of qla2x00_process_els()"), intended to change: bsg_job->request->msgcode == FC_BSG_HST_ELS_NOLOGIN to: bsg_job->request->msgcode != FC_BSG_RPT_ELS but changed it to: bsg_job->request->msgcode == FC_BSG_RPT_ELS instead. Change the == to a != to avoid leaking the fcport structure or freeing unallocated memory. Link: https://lore.kernel.org/r/[email protected] Fixes: 8c0eb59 ("[SCSI] qla2xxx: Fix a memory leak in an error path of qla2x00_process_els()") Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Joy Gu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 06634d5 commit 7fb223d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/qla2xxx/qla_bsg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ qla2x00_process_els(struct bsg_job *bsg_job)
431431
goto done_free_fcport;
432432

433433
done_free_fcport:
434-
if (bsg_request->msgcode == FC_BSG_RPT_ELS)
434+
if (bsg_request->msgcode != FC_BSG_RPT_ELS)
435435
qla2x00_free_fcport(fcport);
436436
done:
437437
return rval;

0 commit comments

Comments
 (0)