Commit 312320b
scsi: lpfc: Check kzalloc() in lpfc_sli4_cgn_params_read()
If kzalloc() fails in lpfc_sli4_cgn_params_read(), then we rely on
lpfc_read_object()'s routine to NULL check pdata.
Currently, an early return error is thrown from lpfc_read_object() to
protect us from NULL ptr dereference, but the errno code is -ENODEV.
Change the errno code to a more appropriate -ENOMEM.
Reported-by: Kang Chen <void0red@gmail.com>
Link: https://lore.kernel.org/all/20230226102338.3362585-1-void0red@gmail.com
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20230228044336.5195-1-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>1 parent c9507ea commit 312320b
2 files changed
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7291 | 7291 | | |
7292 | 7292 | | |
7293 | 7293 | | |
| 7294 | + | |
| 7295 | + | |
7294 | 7296 | | |
7295 | 7297 | | |
7296 | 7298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22109 | 22109 | | |
22110 | 22110 | | |
22111 | 22111 | | |
22112 | | - | |
22113 | | - | |
22114 | | - | |
22115 | | - | |
22116 | 22112 | | |
22117 | 22113 | | |
22118 | 22114 | | |
| |||
0 commit comments