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]
Message-ID: <0c674943bf574bcb91a7b5b87180f7c1@realtek.com>
Date:   Tue, 14 Nov 2023 07:04:01 +0000
From:   Stanley Chang[昌育德] <stanley_chang@...ltek.com>
To:     Johan Hovold <johan@...nel.org>
CC:     Thinh Nguyen <Thinh.Nguyen@...opsys.com>,
        Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v1] usb: dwc3: add device put function to decrement the ref-counted reference

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@...ltek.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ