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: <0f5269c041624dbbae3c70892eab8a6d@realtek.com>
Date:   Thu, 14 Dec 2023 12:44:14 +0000
From:   JustinLai0215 <justinlai0215@...ltek.com>
To:     Paolo Abeni <pabeni@...hat.com>,
        "kuba@...nel.org" <kuba@...nel.org>
CC:     "davem@...emloft.net" <davem@...emloft.net>,
        "edumazet@...gle.com" <edumazet@...gle.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "andrew@...n.ch" <andrew@...n.ch>,
        Ping-Ke Shih <pkshih@...ltek.com>,
        Larry Chiu <larry.chiu@...ltek.com>
Subject: RE: [PATCH net-next v14 02/13] rtase: Implement the .ndo_open function



> -----Original Message-----
> From: Paolo Abeni <pabeni@...hat.com>
> Sent: Tuesday, December 12, 2023 5:50 PM
> To: JustinLai0215 <justinlai0215@...ltek.com>; kuba@...nel.org
> Cc: davem@...emloft.net; edumazet@...gle.com;
> linux-kernel@...r.kernel.org; netdev@...r.kernel.org; andrew@...n.ch;
> Ping-Ke Shih <pkshih@...ltek.com>; Larry Chiu <larry.chiu@...ltek.com>
> Subject: Re: [PATCH net-next v14 02/13] rtase: Implement the .ndo_open
> function
> 
> 
> External mail.
> 
> 
> 
> On Fri, 2023-12-08 at 17:47 +0800, Justin Lai wrote:
> > +static int rtase_open(struct net_device *dev) {
> > +     struct rtase_private *tp = netdev_priv(dev);
> > +     struct rtase_int_vector *ivec = &tp->int_vector[0];
> > +     const struct pci_dev *pdev = tp->pdev;
> > +     int ret;
> > +     u16 i;
> > +
> > +     rtase_set_rxbufsize(tp);
> > +
> > +     ret = rtase_alloc_desc(tp);
> > +     if (ret)
> > +             goto err_free_all_allocated_mem;
> > +
> > +     ret = rtase_init_ring(dev);
> > +     if (ret)
> > +             goto err_free_all_allocated_mem;
> > +
> > +     rtase_hw_config(dev);
> > +
> > +     if (tp->sw_flag & SWF_MSIX_ENABLED) {
> > +             ret = request_irq(ivec->irq, rtase_interrupt, 0,
> > +                               dev->name, ivec);
> > +
> > +             /* request other interrupts to handle multiqueue */
> > +             for (i = 1; i < tp->int_nums; i++) {
> > +                     if (ret)
> > +                             continue;
> > +
> > +                     ivec = &tp->int_vector[i];
> > +                     if (ivec->status != 1)
> > +                             continue;
> > +
> > +                     snprintf(ivec->name, sizeof(ivec->name),
> "%s_int%i", tp->dev->name, i);
> > +                     ret = request_irq(ivec->irq, rtase_q_interrupt, 0,
> > +                                       ivec->name, ivec);
> 
> It looks like that if the above request_irq fails you will never free
> tp->int_vector[0].irq (and all tp->int_vector[j].irq, for j < i)
> 
Thanks for the reminder, I will fix it.
> 
> Cheers,
> 
> Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ