LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] Check for an error when the clock is enabled.
@ 2018-04-19 13:02 Stefan Potyra
  2018-04-23  7:55 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Potyra @ 2018-04-19 13:02 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel
  Cc: ldv-project, sil2review

Found by Linux Driver Verification project (linuxtesting.org).

Fixes: 0814e8d5da2b sc16is7xx: enable the clock
Signed-off-by: Stefan Potyra <Stefan.Potyra@elektrobit.com>
---
 drivers/tty/serial/sc16is7xx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index 65792a3539d0..243c96025053 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -1168,7 +1168,10 @@ static int sc16is7xx_probe(struct device *dev,
 		else
 			return PTR_ERR(s->clk);
 	} else {
-		clk_prepare_enable(s->clk);
+		ret = clk_prepare_enable(s->clk);
+		if (ret)
+			return ret;
+
 		freq = clk_get_rate(s->clk);
 	}
 
-- 
2.17.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Check for an error when the clock is enabled.
  2018-04-19 13:02 [PATCH] Check for an error when the clock is enabled Stefan Potyra
@ 2018-04-23  7:55 ` Greg Kroah-Hartman
  2018-04-24 16:03   ` [PATCH v2] sc16is7xx: " Stefan Potyra
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2018-04-23  7:55 UTC (permalink / raw)
  To: Stefan Potyra
  Cc: Jiri Slaby, linux-serial, linux-kernel, ldv-project, sil2review

On Thu, Apr 19, 2018 at 03:02:28PM +0200, Stefan Potyra wrote:
> Found by Linux Driver Verification project (linuxtesting.org).

Please fix up your subject line to have something "real" in it, along
with the proper prefix.

And put more context here in the changelog, saying why you are doing
this, this "empty line" doesn't mean anything.

> 
> Fixes: 0814e8d5da2b sc16is7xx: enable the clock

Fixes: 0814e8d5da2b ("sc16is7xx: enable the clock")

is the correct format.

> Signed-off-by: Stefan Potyra <Stefan.Potyra@elektrobit.com>
> ---
>  drivers/tty/serial/sc16is7xx.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
> index 65792a3539d0..243c96025053 100644
> --- a/drivers/tty/serial/sc16is7xx.c
> +++ b/drivers/tty/serial/sc16is7xx.c
> @@ -1168,7 +1168,10 @@ static int sc16is7xx_probe(struct device *dev,
>  		else
>  			return PTR_ERR(s->clk);
>  	} else {
> -		clk_prepare_enable(s->clk);
> +		ret = clk_prepare_enable(s->clk);
> +		if (ret)
> +			return ret;
> +

Please fix up the above and resend.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] sc16is7xx: Check for an error when the clock is enabled.
  2018-04-23  7:55 ` Greg Kroah-Hartman
@ 2018-04-24 16:03   ` Stefan Potyra
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Potyra @ 2018-04-24 16:03 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-serial, linux-kernel, ldv-project, sil2review

When the clock is enabled, check if there is an error. Otherwise
clk_get_rate() can be called without enabled clock.

Found by Linux Driver Verification project (linuxtesting.org).

Fixes: 0814e8d5da2b ("sc16is7xx: enable the clock")
Signed-off-by: Stefan Potyra <Stefan.Potyra@elektrobit.com>
---
 drivers/tty/serial/sc16is7xx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index 65792a3539d0..243c96025053 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -1168,7 +1168,10 @@ static int sc16is7xx_probe(struct device *dev,
 		else
 			return PTR_ERR(s->clk);
 	} else {
-		clk_prepare_enable(s->clk);
+		ret = clk_prepare_enable(s->clk);
+		if (ret)
+			return ret;
+
 		freq = clk_get_rate(s->clk);
 	}
 
-- 
2.17.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-24 16:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-19 13:02 [PATCH] Check for an error when the clock is enabled Stefan Potyra
2018-04-23  7:55 ` Greg Kroah-Hartman
2018-04-24 16:03   ` [PATCH v2] sc16is7xx: " Stefan Potyra

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).