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: <87o6xy4tpy.ffs@tglx>
Date: Tue, 18 Mar 2025 09:40:41 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: James Bottomley <James.Bottomley@...senPartnership.com>, LKML
 <linux-kernel@...r.kernel.org>
Cc: Marc Zyngier <maz@...nel.org>, Peter Zijlstra <peterz@...radead.org>,
 Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>, "Martin K.
 Petersen" <martin.petersen@...cle.com>, linux-scsi@...r.kernel.org,
 Jonathan Cameron <Jonathan.Cameron@...wei.com>, Nishanth Menon
 <nm@...com>, Dhruva Gole <d-gole@...com>, Tero Kristo <kristo@...nel.org>,
 Santosh Shilimkar <ssantosh@...nel.org>, Logan Gunthorpe
 <logang@...tatee.com>, Dave Jiang <dave.jiang@...el.com>, Jon Mason
 <jdmason@...zu.us>, Allen Hubbe <allenbh@...il.com>, ntb@...ts.linux.dev,
 Bjorn Helgaas <bhelgaas@...gle.com>, linux-pci@...r.kernel.org, Michael
 Kelley <mhklinux@...look.com>, Wei Liu <wei.liu@...nel.org>, Haiyang Zhang
 <haiyangz@...rosoft.com>, linux-hyperv@...r.kernel.org, Wei Huang
 <wei.huang2@....com>, Jonathan Cameron <Jonathan.Cameron@...wei.com>
Subject: Re: [patch V3 09/10] scsi: ufs: qcom: Remove the MSI descriptor abuse

On Mon, Mar 17 2025 at 12:26, James Bottomley wrote:
>>  	nr_irqs = hba->nr_hw_queues - hba-
>> >nr_queues[HCTX_TYPE_POLL];
>> +	qi = devm_kcalloc(hba->dev, nr_irqs, sizeof(*qi),
>> GFP_KERNEL);
>> +	if (qi)
>
> Typo causing logic inversion: should be !qi here (you need a more
> responsive ! key).

Duh.

>> +cleanup:
>> +	for (int idx = 0; qi[idx].irq; idx++)
>> +		devm_free_irq(hba->dev, qi[idx].irq, hba);
>> +	platform_device_msi_free_irqs_all(hba->dev);
>> +	devm_kfree(hba->dev, qi);
>>  	return ret;
>>  }
>
> This does seem to be exactly the pattern you describe in 1/10, although

True.

> I'm not entirely convinced that something like the below is more
> readable and safe.

At least the cleanup wants to be in a C function and not hideously
hidden in the DEFINE_FREE() macro.

Let me respin that.

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ