* [PATCH] usb: gadget: m66592-udc: Add check for clk_enable()
@ 2024-12-15 20:53 Mingwei Zheng
2024-12-16 7:55 ` Greg KH
0 siblings, 1 reply; 7+ messages in thread
From: Mingwei Zheng @ 2024-12-15 20:53 UTC (permalink / raw)
To: gregkh, u.kleine-koenig
Cc: linux-usb, linux-kernel, Mingwei Zheng, Jiasheng Jiang
Add check for the return value of clk_enable() to catch the potential
error.
Fixes: b4822e2317e8 ("usb: gadget: m66592-udc: Convert to use module_platform_driver()")
Signed-off-by: Mingwei Zheng <zmw12306@gmail.com>
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
---
drivers/usb/gadget/udc/m66592-udc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/m66592-udc.c b/drivers/usb/gadget/udc/m66592-udc.c
index a938b2af0944..bf408476a24c 100644
--- a/drivers/usb/gadget/udc/m66592-udc.c
+++ b/drivers/usb/gadget/udc/m66592-udc.c
@@ -1606,7 +1606,11 @@ static int m66592_probe(struct platform_device *pdev)
ret = PTR_ERR(m66592->clk);
goto clean_up2;
}
- clk_enable(m66592->clk);
+ ret = clk_enable(m66592->clk);
+ if (ret) {
+ clk_put(m66592->clk);
+ goto clean_up2;
+ }
}
INIT_LIST_HEAD(&m66592->gadget.ep_list);
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] usb: gadget: m66592-udc: Add check for clk_enable()
2024-12-15 20:53 Mingwei Zheng
@ 2024-12-16 7:55 ` Greg KH
2024-12-18 3:06 ` Mingwei Zheng
0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2024-12-16 7:55 UTC (permalink / raw)
To: Mingwei Zheng; +Cc: u.kleine-koenig, linux-usb, linux-kernel, Jiasheng Jiang
On Sun, Dec 15, 2024 at 03:53:58PM -0500, Mingwei Zheng wrote:
> Add check for the return value of clk_enable() to catch the potential
> error.
>
> Fixes: b4822e2317e8 ("usb: gadget: m66592-udc: Convert to use module_platform_driver()")
> Signed-off-by: Mingwei Zheng <zmw12306@gmail.com>
> Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Why this order of signed-off-by lines? Shouldn't yours be last? Who
wrote this patch?
> ---
> drivers/usb/gadget/udc/m66592-udc.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/udc/m66592-udc.c b/drivers/usb/gadget/udc/m66592-udc.c
> index a938b2af0944..bf408476a24c 100644
> --- a/drivers/usb/gadget/udc/m66592-udc.c
> +++ b/drivers/usb/gadget/udc/m66592-udc.c
> @@ -1606,7 +1606,11 @@ static int m66592_probe(struct platform_device *pdev)
> ret = PTR_ERR(m66592->clk);
> goto clean_up2;
> }
> - clk_enable(m66592->clk);
> + ret = clk_enable(m66592->clk);
> + if (ret) {
> + clk_put(m66592->clk);
> + goto clean_up2;
> + }
How did you find this and how was it tested?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] usb: gadget: m66592-udc: Add check for clk_enable()
2024-12-16 7:55 ` Greg KH
@ 2024-12-18 3:06 ` Mingwei Zheng
2024-12-23 17:30 ` Greg KH
0 siblings, 1 reply; 7+ messages in thread
From: Mingwei Zheng @ 2024-12-18 3:06 UTC (permalink / raw)
To: Greg KH; +Cc: u.kleine-koenig, linux-usb, linux-kernel, Jiasheng Jiang
Hi Greg,
On Mon, Dec 16, 2024 at 2:56 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Sun, Dec 15, 2024 at 03:53:58PM -0500, Mingwei Zheng wrote:
> > Add check for the return value of clk_enable() to catch the potential
> > error.
> >
> > Fixes: b4822e2317e8 ("usb: gadget: m66592-udc: Convert to use module_platform_driver()")
> > Signed-off-by: Mingwei Zheng <zmw12306@gmail.com>
> > Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
>
> Why this order of signed-off-by lines? Shouldn't yours be last? Who
> wrote this patch?
>
I listed two names because both of us co-authored this patch.
> > ---
> > drivers/usb/gadget/udc/m66592-udc.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/gadget/udc/m66592-udc.c b/drivers/usb/gadget/udc/m66592-udc.c
> > index a938b2af0944..bf408476a24c 100644
> > --- a/drivers/usb/gadget/udc/m66592-udc.c
> > +++ b/drivers/usb/gadget/udc/m66592-udc.c
> > @@ -1606,7 +1606,11 @@ static int m66592_probe(struct platform_device *pdev)
> > ret = PTR_ERR(m66592->clk);
> > goto clean_up2;
> > }
> > - clk_enable(m66592->clk);
> > + ret = clk_enable(m66592->clk);
> > + if (ret) {
> > + clk_put(m66592->clk);
> > + goto clean_up2;
> > + }
>
> How did you find this and how was it tested?
>
> thanks,
>
> greg k-h
We found it through a static analysis tool. Additionally, we validated
the patch's correctness
using the built-in tests provided during the compilation process.
Please kindly let me know if you need further details or have any
questions. Thank you!
Best,
Mingwei
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] usb: gadget: m66592-udc: Add check for clk_enable()
2024-12-18 3:06 ` Mingwei Zheng
@ 2024-12-23 17:30 ` Greg KH
2024-12-26 1:35 ` Mingwei Zheng
0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2024-12-23 17:30 UTC (permalink / raw)
To: Mingwei Zheng; +Cc: u.kleine-koenig, linux-usb, linux-kernel, Jiasheng Jiang
On Tue, Dec 17, 2024 at 10:06:26PM -0500, Mingwei Zheng wrote:
> Hi Greg,
>
> On Mon, Dec 16, 2024 at 2:56 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Sun, Dec 15, 2024 at 03:53:58PM -0500, Mingwei Zheng wrote:
> > > Add check for the return value of clk_enable() to catch the potential
> > > error.
> > >
> > > Fixes: b4822e2317e8 ("usb: gadget: m66592-udc: Convert to use module_platform_driver()")
> > > Signed-off-by: Mingwei Zheng <zmw12306@gmail.com>
> > > Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
> >
> > Why this order of signed-off-by lines? Shouldn't yours be last? Who
> > wrote this patch?
> >
>
> I listed two names because both of us co-authored this patch.
>
> > > ---
> > > drivers/usb/gadget/udc/m66592-udc.c | 6 +++++-
> > > 1 file changed, 5 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/usb/gadget/udc/m66592-udc.c b/drivers/usb/gadget/udc/m66592-udc.c
> > > index a938b2af0944..bf408476a24c 100644
> > > --- a/drivers/usb/gadget/udc/m66592-udc.c
> > > +++ b/drivers/usb/gadget/udc/m66592-udc.c
> > > @@ -1606,7 +1606,11 @@ static int m66592_probe(struct platform_device *pdev)
> > > ret = PTR_ERR(m66592->clk);
> > > goto clean_up2;
> > > }
> > > - clk_enable(m66592->clk);
> > > + ret = clk_enable(m66592->clk);
> > > + if (ret) {
> > > + clk_put(m66592->clk);
> > > + goto clean_up2;
> > > + }
> >
> > How did you find this and how was it tested?
> >
> > thanks,
> >
> > greg k-h
>
> We found it through a static analysis tool.
Then you need to properly document that as our documentation says it is
required, right?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] usb: gadget: m66592-udc: Add check for clk_enable()
@ 2024-12-24 20:22 Mingwei Zheng
2024-12-26 8:19 ` Greg KH
0 siblings, 1 reply; 7+ messages in thread
From: Mingwei Zheng @ 2024-12-24 20:22 UTC (permalink / raw)
To: gregkh
Cc: u.kleine-koenig, linux-usb, linux-kernel, Mingwei Zheng,
Jiasheng Jiang
The APP-Miner reported the missing check.
Add check for the return value of clk_enable() to catch the potential
error.
Fixes: b4822e2317e8 ("usb: gadget: m66592-udc: Convert to use module_platform_driver()")
Signed-off-by: Mingwei Zheng <zmw12306@gmail.com>
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
---
drivers/usb/gadget/udc/m66592-udc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/m66592-udc.c b/drivers/usb/gadget/udc/m66592-udc.c
index a938b2af0944..bf408476a24c 100644
--- a/drivers/usb/gadget/udc/m66592-udc.c
+++ b/drivers/usb/gadget/udc/m66592-udc.c
@@ -1606,7 +1606,11 @@ static int m66592_probe(struct platform_device *pdev)
ret = PTR_ERR(m66592->clk);
goto clean_up2;
}
- clk_enable(m66592->clk);
+ ret = clk_enable(m66592->clk);
+ if (ret) {
+ clk_put(m66592->clk);
+ goto clean_up2;
+ }
}
INIT_LIST_HEAD(&m66592->gadget.ep_list);
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] usb: gadget: m66592-udc: Add check for clk_enable()
2024-12-23 17:30 ` Greg KH
@ 2024-12-26 1:35 ` Mingwei Zheng
0 siblings, 0 replies; 7+ messages in thread
From: Mingwei Zheng @ 2024-12-26 1:35 UTC (permalink / raw)
To: Greg KH; +Cc: u.kleine-koenig, linux-usb, linux-kernel, Jiasheng Jiang
Hi Greg,
On Mon, Dec 23, 2024 at 12:46 PM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Tue, Dec 17, 2024 at 10:06:26PM -0500, Mingwei Zheng wrote:
> > Hi Greg,
> >
> > On Mon, Dec 16, 2024 at 2:56 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> > >
> > > On Sun, Dec 15, 2024 at 03:53:58PM -0500, Mingwei Zheng wrote:
> > > > Add check for the return value of clk_enable() to catch the potential
> > > > error.
> > > >
> > > > Fixes: b4822e2317e8 ("usb: gadget: m66592-udc: Convert to use module_platform_driver()")
> > > > Signed-off-by: Mingwei Zheng <zmw12306@gmail.com>
> > > > Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
> > >
> > > Why this order of signed-off-by lines? Shouldn't yours be last? Who
> > > wrote this patch?
> > >
> >
> > I listed two names because both of us co-authored this patch.
> >
> > > > ---
> > > > drivers/usb/gadget/udc/m66592-udc.c | 6 +++++-
> > > > 1 file changed, 5 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/usb/gadget/udc/m66592-udc.c b/drivers/usb/gadget/udc/m66592-udc.c
> > > > index a938b2af0944..bf408476a24c 100644
> > > > --- a/drivers/usb/gadget/udc/m66592-udc.c
> > > > +++ b/drivers/usb/gadget/udc/m66592-udc.c
> > > > @@ -1606,7 +1606,11 @@ static int m66592_probe(struct platform_device *pdev)
> > > > ret = PTR_ERR(m66592->clk);
> > > > goto clean_up2;
> > > > }
> > > > - clk_enable(m66592->clk);
> > > > + ret = clk_enable(m66592->clk);
> > > > + if (ret) {
> > > > + clk_put(m66592->clk);
> > > > + goto clean_up2;
> > > > + }
> > >
> > > How did you find this and how was it tested?
> > >
> > > thanks,
> > >
> > > greg k-h
> >
> > We found it through a static analysis tool.
>
> Then you need to properly document that as our documentation says it is
> required, right?
>
> thanks,
>
> greg k-h
I send a PATCH v2 specifying the tool name in the commit msg for
your review. Thank you so much for your suggestion!
Best,
Mingwei
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] usb: gadget: m66592-udc: Add check for clk_enable()
2024-12-24 20:22 [PATCH] usb: gadget: m66592-udc: Add check for clk_enable() Mingwei Zheng
@ 2024-12-26 8:19 ` Greg KH
0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2024-12-26 8:19 UTC (permalink / raw)
To: Mingwei Zheng; +Cc: u.kleine-koenig, linux-usb, linux-kernel, Jiasheng Jiang
On Tue, Dec 24, 2024 at 03:22:17PM -0500, Mingwei Zheng wrote:
> The APP-Miner reported the missing check.
What does this mean? Please explain it better as the documentation
states you must do when using random research tools.
> Add check for the return value of clk_enable() to catch the potential
> error.
>
> Fixes: b4822e2317e8 ("usb: gadget: m66592-udc: Convert to use module_platform_driver()")
Why is this only a Fixes tag and not also a cc: stable? And how did you
test it?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-12-26 8:20 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-24 20:22 [PATCH] usb: gadget: m66592-udc: Add check for clk_enable() Mingwei Zheng
2024-12-26 8:19 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2024-12-15 20:53 Mingwei Zheng
2024-12-16 7:55 ` Greg KH
2024-12-18 3:06 ` Mingwei Zheng
2024-12-23 17:30 ` Greg KH
2024-12-26 1:35 ` Mingwei Zheng
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).