From: "Stanley Chang[昌育德]" <stanley_chang@realtek.com>
To: Johan Hovold <johan@kernel.org>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v1] usb: dwc3: add device put function to decrement the ref-counted reference
Date: Tue, 14 Nov 2023 07:04:01 +0000 [thread overview]
Message-ID: <0c674943bf574bcb91a7b5b87180f7c1@realtek.com> (raw)
In-Reply-To: <ZU9bPMHqz7Gj4rHj@hovoldconsulting.com>
Hi Johan,
>
> On Tue, Nov 07, 2023 at 05:12:51PM +0800, Stanley Chang wrote:
> > When the function exits, the count should be decremented via
> > platform_device_put and of_node_put.
>
> This isn't really a self-contained commit message (and your use of 'count' is
> too vague). You're also changing two functions in two different ways here.
I will modify the commit message.
> > Fixes: 34c200483569 ("usb: dwc3: add Realtek DHC RTD SoC dwc3 glue
> > layer driver")
> > Signed-off-by: Stanley Chang <stanley_chang@realtek.com>
> > ---
> > drivers/usb/dwc3/dwc3-rtk.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/usb/dwc3/dwc3-rtk.c b/drivers/usb/dwc3/dwc3-rtk.c
> > index 590028e8fdcb..9d6f2a8bd6ce 100644
> > --- a/drivers/usb/dwc3/dwc3-rtk.c
> > +++ b/drivers/usb/dwc3/dwc3-rtk.c
> > @@ -187,6 +187,7 @@ static enum usb_device_speed
> > __get_dwc3_maximum_speed(struct device_node *np)
> >
> > ret = match_string(speed_names, ARRAY_SIZE(speed_names),
> > maximum_speed);
> >
> > + of_node_put(dwc3_np);
I will fixed this.
Thanks,
Stanley
> You're still leaking a reference in the of_property_read_string() error path just
> above.
>
> > return (ret < 0) ? USB_SPEED_UNKNOWN : ret; }
> >
> > @@ -339,6 +340,8 @@ static int dwc3_rtk_probe_dwc3_core(struct
> > dwc3_rtk *rtk)
> >
> > switch_usb2_role(rtk, rtk->cur_role);
> >
> > + platform_device_put(dwc3_pdev);
> > + of_node_put(dwc3_node);
>
> Please keep the new line before return for readability.
>
> > return 0;
> >
> > err_pdev_put:
>
> Johan
prev parent reply other threads:[~2023-11-14 7:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-07 9:12 Stanley Chang
2023-11-10 2:34 ` Thinh Nguyen
2023-11-10 2:43 ` Stanley Chang[昌育德]
2023-11-10 22:54 ` Thinh Nguyen
2023-11-11 10:45 ` Johan Hovold
2023-11-14 7:04 ` Stanley Chang[昌育德] [this message]
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=0c674943bf574bcb91a7b5b87180f7c1@realtek.com \
--to=stanley_chang@realtek.com \
--cc=Thinh.Nguyen@synopsys.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/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
all inboxes | Powered by JetHome®