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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 13 Sep 2022 10:23:32 +0800
From:   Yang Yingliang <yangyingliang@...wei.com>
To:     Oded Gabbay <ogabbay@...nel.org>
CC:     "Linux-Kernel@...r. Kernel. Org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] habanalabs/gaudi2: fix free irq in error path in
 gaudi2_enable_msix()


On 2022/8/29 18:14, Oded Gabbay wrote:
> On Thu, Aug 25, 2022 at 4:23 PM Yang Yingliang <yangyingliang@...wei.com> wrote:
>> Add two variables to store completion irq and event queue irq. And add
>> a new lable to free event queue irq in error path in gaudi2_enable_msix().
>>
>> Fixes: d7bb1ac89b2f ("habanalabs: add gaudi2 asic-specific code")
>> Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
>> ---
>>   drivers/misc/habanalabs/gaudi2/gaudi2.c | 21 +++++++++++++--------
>>   1 file changed, 13 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/misc/habanalabs/gaudi2/gaudi2.c b/drivers/misc/habanalabs/gaudi2/gaudi2.c
>> index 98336a1a84b0..54eca19b270b 100644
>> --- a/drivers/misc/habanalabs/gaudi2/gaudi2.c
>> +++ b/drivers/misc/habanalabs/gaudi2/gaudi2.c
>> @@ -3518,6 +3518,7 @@ static int gaudi2_enable_msix(struct hl_device *hdev)
>>          struct asic_fixed_properties *prop = &hdev->asic_prop;
>>          struct gaudi2_device *gaudi2 = hdev->asic_specific;
>>          int rc, irq, i, j, user_irq_init_cnt;
>> +       int completion_irq, event_queue_irq;
>>          irq_handler_t irq_handler;
>>          struct hl_cq *cq;
>>
>> @@ -3532,17 +3533,19 @@ static int gaudi2_enable_msix(struct hl_device *hdev)
>>                  return rc;
>>          }
>>
>> -       irq = pci_irq_vector(hdev->pdev, GAUDI2_IRQ_NUM_COMPLETION);
>> +       completion_irq = pci_irq_vector(hdev->pdev, GAUDI2_IRQ_NUM_COMPLETION);
>>          cq = &hdev->completion_queue[GAUDI2_RESERVED_CQ_CS_COMPLETION];
>> -       rc = request_irq(irq, hl_irq_handler_cq, 0, gaudi2_irq_name(GAUDI2_IRQ_NUM_COMPLETION), cq);
>> +       rc = request_irq(completion_irq, hl_irq_handler_cq, 0,
>> +                        gaudi2_irq_name(GAUDI2_IRQ_NUM_COMPLETION), cq);
>>          if (rc) {
>>                  dev_err(hdev->dev, "Failed to request IRQ %d", irq);
> Please fix the error prints to print the correct irq.
OK.
> And I think you should remove the "irq" local variable completely.
'irq' will be used later, it can not be removed.

Thanks,
Yang
>
> Oded
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ