scsi: qla2xxx: Return -ENOMEM if kzalloc() fails
Subsystems (2)
PATCH 1/1 scsi: qla2xxx: Return -ENOMEM if kzalloc() fails
During the process of driver probing, probe function should return < 0 for failure, otherwise kernel will treat value > 0 as success.
Signed-off-by Zheyu Ma <[email protected]>
--- drivers/scsi/qla2xxx/qla_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_os.c +1 -1
@@ -4157,7 +4157,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,ql_dbg_pci (ql_dbg_init, ha->pdev,0xe0ee ,"%s: failed alloc dsd\n" , __func__); -return 1 ; +return -ENOMEM ; } ha->dif_bundle_kallocs++;
Signature · 1 line
2.17.6
Quoted 28 lines · Zheyu Ma
During the process of driver probing, probe function should return < 0 for failure, otherwise kernel will treat value > 0 as success.
Signed-off-by Zheyu Ma <[email protected]>---
drivers/scsi/qla2xxx/qla_os.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/qla2xxx/qla_os.c +1
-1@@ -4157,7 +4157,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,ql_dbg_pci (ql_dbg_init, ha->pdev,0xe0ee ,"%s: failed alloc dsd\n" , __func__); -return 1 ; +return -ENOMEM ; } ha->dif_bundle_kallocs++;Signature · 1 line
2.17.6
Reviewed-by Himanshu Madhani <[email protected]>
--
Himanshu Madhani Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 4 lines · Zheyu Ma
During the process of driver probing, probe function should return < 0 for failure, otherwise kernel will treat value > 0 as success.
Applied to 5.15/scsi-fixes, thanks!
[1/1] scsi: qla2xxx: Return -ENOMEM if kzalloc() fails
https://git.kernel.org/mkp/scsi/c/06634d5b6e92
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering