diff options
| author | Damien Le Moal <damien.lemoal@opensource.wdc.com> | 2022-02-20 12:17:56 +0900 |
|---|---|---|
| committer | Martin K. Petersen <martin.petersen@oracle.com> | 2022-02-22 21:31:19 -0500 |
| commit | f17c599a44fca3d04bd1bed3f452c104d9e48cab (patch) | |
| tree | 83814c9ea751d30a000e04978b84b10c555ad032 /lib/mpi/mpi-cmp.c | |
| parent | 7f12845c8389855dbcc67baa068b6832dc4a396e (diff) | |
scsi: pm8001: Fix pm8001_tag_alloc() failures handling
In mpi_set_phy_profile_req() and in pm8001_set_phy_profile_single(), if
pm8001_tag_alloc() fails to allocate a new tag, a warning message is issued
but the uninitialized tag variable is still used to build a command. Avoid
this by returning early in case of tag allocation failure.
Also make sure to always return the error code returned by
pm8001_tag_alloc() when this function fails instead of an arbitrary value.
Link: https://lore.kernel.org/r/20220220031810.738362-18-damien.lemoal@opensource.wdc.com
Reviewed-by: John Garry <john.garry@huawei.com>
Reviewed-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'lib/mpi/mpi-cmp.c')
0 files changed, 0 insertions, 0 deletions
