Re: [PATCH] pci, msi: return if alloc_msi_entry for MSI-X failed

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

 



Michael Ellerman wrote:
> On Fri, 2009-05-15 at 13:59 +0900, Hidetoshi Seto wrote:
>> @@ -445,8 +445,10 @@ static int msix_capability_init(struct pci_dev *dev,
>>  	/* MSI-X Table Initialization */
>>  	for (i = 0; i < nvec; i++) {
>>  		entry = alloc_msi_entry(dev);
>> -		if (!entry)
>> -			break;
>> +		if (!entry) {
>> +			msi_free_irqs(dev);
>> +			return i;
>> +		}
>>  
>>   		j = entries[i].entry;
>>  		entry->msi_attrib.is_msix = 1;
> 
> That looks right to me. Have you tested it? By faking allocation failure
> in alloc_msi_entry().

Oops, my test found a bug... we should return -ENOMEM if it fails with i==0.
I'll post v2 with my Tested-by soon.  Sorry, please review it again.

> I guess this would be a nice fix for 30, but no one's hit it yet so it's
> not urgent and could wait for 31.

I agree with it.


Thanks,
H.Seto

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux