From: JustinLai0215 <justinlai0215@realtek.com>
To: Paolo Abeni <pabeni@redhat.com>, "kuba@kernel.org" <kuba@kernel.org>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"andrew@lunn.ch" <andrew@lunn.ch>,
Ping-Ke Shih <pkshih@realtek.com>,
Larry Chiu <larry.chiu@realtek.com>
Subject: RE: [PATCH net-next v14 02/13] rtase: Implement the .ndo_open function
Date: Thu, 14 Dec 2023 12:44:14 +0000 [thread overview]
Message-ID: <0f5269c041624dbbae3c70892eab8a6d@realtek.com> (raw)
In-Reply-To: <a18c5b93b9732575048c551268a92935db4dbf48.camel@redhat.com>
> -----Original Message-----
> From: Paolo Abeni <pabeni@redhat.com>
> Sent: Tuesday, December 12, 2023 5:50 PM
> To: JustinLai0215 <justinlai0215@realtek.com>; kuba@kernel.org
> Cc: davem@davemloft.net; edumazet@google.com;
> linux-kernel@vger.kernel.org; netdev@vger.kernel.org; andrew@lunn.ch;
> Ping-Ke Shih <pkshih@realtek.com>; Larry Chiu <larry.chiu@realtek.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
next prev parent reply other threads:[~2023-12-14 12:44 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-08 9:47 [PATCH net-next v14 00/13] Add Realtek automotive PCIe driver Justin Lai
2023-12-08 9:47 ` [PATCH net-next v14 01/13] rtase: Add pci table supported in this module Justin Lai
2023-12-12 9:36 ` Paolo Abeni
2023-12-12 16:05 ` Jakub Kicinski
2023-12-14 12:42 ` JustinLai0215
2023-12-08 9:47 ` [PATCH net-next v14 02/13] rtase: Implement the .ndo_open function Justin Lai
2023-12-12 9:49 ` Paolo Abeni
2023-12-14 12:44 ` JustinLai0215 [this message]
2023-12-08 9:47 ` [PATCH net-next v14 03/13] rtase: Implement the rtase_down function Justin Lai
2023-12-12 19:27 ` Jakub Kicinski
2023-12-14 12:54 ` JustinLai0215
2023-12-08 9:47 ` [PATCH net-next v14 04/13] rtase: Implement the interrupt routine and rtase_poll Justin Lai
2023-12-08 9:47 ` [PATCH net-next v14 05/13] rtase: Implement hardware configuration function Justin Lai
2023-12-08 9:47 ` [PATCH net-next v14 06/13] rtase: Implement .ndo_start_xmit function Justin Lai
2023-12-12 19:32 ` Jakub Kicinski
2023-12-14 13:00 ` JustinLai0215
2023-12-14 17:24 ` Jakub Kicinski
2023-12-18 10:27 ` Justin Lai
2023-12-08 9:47 ` [PATCH net-next v14 07/13] rtase: Implement a function to receive packets Justin Lai
2023-12-12 10:04 ` Paolo Abeni
2023-12-14 12:45 ` JustinLai0215
2023-12-18 10:18 ` Justin Lai
2023-12-08 9:47 ` [PATCH net-next v14 08/13] rtase: Implement net_device_ops Justin Lai
2023-12-12 10:09 ` Paolo Abeni
2023-12-14 12:47 ` JustinLai0215
2023-12-08 9:47 ` [PATCH net-next v14 09/13] rtase: Implement pci_driver suspend and resume function Justin Lai
2023-12-12 19:19 ` Jakub Kicinski
2023-12-14 12:48 ` JustinLai0215
2023-12-08 9:47 ` [PATCH net-next v14 10/13] rtase: Implement ethtool function Justin Lai
2023-12-12 19:21 ` Jakub Kicinski
2023-12-08 9:47 ` [PATCH net-next v14 11/13] rtase: Add a Makefile in the rtase folder Justin Lai
2023-12-08 9:47 ` [PATCH net-next v14 12/13] realtek: Update the Makefile and Kconfig in the realtek folder Justin Lai
2023-12-08 9:47 ` [PATCH net-next v14 13/13] MAINTAINERS: Add the rtase ethernet driver entry Justin Lai
2023-12-12 19:22 ` Jakub Kicinski
2023-12-14 12:51 ` JustinLai0215
2023-12-14 17:27 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0f5269c041624dbbae3c70892eab8a6d@realtek.com \
--to=justinlai0215@realtek.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=larry.chiu@realtek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pkshih@realtek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).