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] [day] [month] [year] [list]
Date:	Mon, 5 May 2014 18:43:53 +0800
From:	黃清隆 <ching2048@...ca.com.tw>
To:	Dan Carpenter <dan.carpenter@...cle.com>
Cc:	James Bottomley <jbottomley@...allels.com>,
	Tomas Henzl <thenzl@...hat.com>,
	"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1.1 2/16] arcmsr: Adding code to support MSI-X interrupt

Hi Dan,

Thanks for correcting this bug.

Regards,
Ching

2014-05-05 18:28 GMT+08:00 Dan Carpenter <dan.carpenter@...cle.com>:
> On Mon, May 05, 2014 at 04:47:11PM +0800, ching wrote:
>> +static int
>> +arcmsr_request_irq(struct pci_dev *pdev, struct AdapterControlBlock *acb)
>> +{
>> +     int     i, j, r;
>> +     struct msix_entry entries[ARCMST_NUM_MSIX_VECTORS];
>> +
>> +     if (!pci_find_capability(pdev, PCI_CAP_ID_MSIX))
>> +             goto msi_int;
>> +     for (i = 0; i < ARCMST_NUM_MSIX_VECTORS; i++)
>> +             entries[i].entry = i;
>> +     r = pci_enable_msix(pdev, entries, ARCMST_NUM_MSIX_VECTORS);
>> +     if (r < 0)
>> +             goto msi_int;
>> +     if (r == 0) {
>> +             for (i = 0; i < ARCMST_NUM_MSIX_VECTORS; i++) {
>> +                     if (request_irq(entries[i].vector,
>> +                             arcmsr_do_interrupt, 0, "arcmsr", acb)) {
>> +                             pr_warn("arcmsr%d: request_irq =%d failed!\n",
>> +                                     acb->host->host_no, pdev->irq);
>> +                             for (j = 0 ; j < i ; j++)
>> +                                     free_irq(entries[i].vector, acb);
>
> This is a bug here.  Sorry for not noticing the first time I reviewed
> this patch.  It should be "j" instead of "i" in
> free_irq(entries[i].vector, acb);.
>
>> +                             pci_disable_msix(pdev);
>> +                             goto msi_int;
>> +                     }
>> +                     acb->entries[i] = entries[i];
>> +             }
>> +             acb->acb_flags |= ACB_F_MSIX_ENABLED;
>> +             pr_info("arcmsr%d: msi-x enabled\n", acb->host->host_no);
>> +             return ARC_SUCCESS;
>> +     } else {
>> +             if (pci_enable_msix(pdev, entries, r))
>> +                     goto msi_int;
>> +             for (i = 0; i < r; i++) {
>> +                     if (request_irq(entries[i].vector,
>> +                             arcmsr_do_interrupt, 0, "arcmsr", acb)) {
>> +                             pr_warn("arcmsr%d: request_irq =%d failed!\n",
>> +                                     acb->host->host_no, pdev->irq);
>> +                             for (j = 0 ; j < i ; j++)
>> +                                     free_irq(entries[i].vector, acb);
>
> The same thing here.
>
> But otherwise so far as style goes this function is a lot better in
> this version.  Thanks.  Also the patchset is split up nicely into
> patches which do one thing per patch so that's nice as well.
>
> regards,
> dan carpenter
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ