Skip to content
Commit f17c599a authored by Damien Le Moal's avatar Damien Le Moal Committed by Martin K. Petersen
Browse files

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: default avatarJohn Garry <john.garry@huawei.com>
Reviewed-by: default avatarJack Wang <jinpu.wang@ionos.com>
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 7f12845c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment