Skip to content

Commit 06634d5

Browse files
ZheyuMamartinkpetersen
authored andcommitted
scsi: qla2xxx: Return -ENOMEM if kzalloc() fails
The driver probing function should return < 0 for failure, otherwise kernel will treat value > 0 as success. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Zheyu Ma <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 85374b6 commit 06634d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4157,7 +4157,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
41574157
ql_dbg_pci(ql_dbg_init, ha->pdev,
41584158
0xe0ee, "%s: failed alloc dsd\n",
41594159
__func__);
4160-
return 1;
4160+
return -ENOMEM;
41614161
}
41624162
ha->dif_bundle_kallocs++;
41634163

0 commit comments

Comments
 (0)