Re: [patch V3 09/10] scsi: ufs: qcom: Remove the MSI descriptor abuse

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux