lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMGffEnbCe1y78O69GpT-gUqY5m5jNLsHbBue8EBMFc-wgcoYw@mail.gmail.com>
Date: Wed, 18 Jun 2025 17:17:40 +0200
From: Jinpu Wang <jinpu.wang@...os.com>
To: Francisco Gutierrez <frankramirez@...gle.com>
Cc: Jack Wang <jinpu.wang@...ud.ionos.com>, 
	"James E.J. Bottomley" <James.Bottomley@...senpartnership.com>, 
	"Martin K. Petersen" <martin.petersen@...cle.com>, linux-scsi@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi: pm80xx: Free allocated tags after failure

On Tue, Jun 17, 2025 at 11:05 PM Francisco Gutierrez
<frankramirez@...gle.com> wrote:
>
> This change frees resources after an error is detected.
>
> Signed-off-by: Francisco Gutierrez <frankramirez@...gle.com>
lgtm.
Acked-by: Jack Wang <jinpu.wang@...os.com>
> ---
>  drivers/scsi/pm8001/pm80xx_hwi.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
> index 5b373c53c0369..c4074f062d931 100644
> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
> @@ -4677,8 +4677,12 @@ pm80xx_chip_phy_start_req(struct pm8001_hba_info *pm8001_ha, u8 phy_id)
>                 &pm8001_ha->phy[phy_id].dev_sas_addr, SAS_ADDR_SIZE);
>         payload.sas_identify.phy_id = phy_id;
>
> -       return pm8001_mpi_build_cmd(pm8001_ha, 0, opcode, &payload,
> +       ret = pm8001_mpi_build_cmd(pm8001_ha, 0, opcode, &payload,
>                                     sizeof(payload), 0);
> +       if (ret < 0)
> +               pm8001_tag_free(pm8001_ha, tag);
> +
> +       return ret;
>  }
>
>  /**
> @@ -4704,8 +4708,12 @@ static int pm80xx_chip_phy_stop_req(struct pm8001_hba_info *pm8001_ha,
>         payload.tag = cpu_to_le32(tag);
>         payload.phy_id = cpu_to_le32(phy_id);
>
> -       return pm8001_mpi_build_cmd(pm8001_ha, 0, opcode, &payload,
> +       ret = pm8001_mpi_build_cmd(pm8001_ha, 0, opcode, &payload,
>                                     sizeof(payload), 0);
> +       if (ret < 0)
> +               pm8001_tag_free(pm8001_ha, tag);
> +
> +       return ret;
>  }
>
>  /*
> --
> 2.50.0.rc2.696.g1fc2a0284f-goog
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ