* [PATCH 2/2] ARM: SAMSUNG: Add check for NULL in clock interface
@ 2012-09-06 14:25 Chander Kashyap
2012-09-14 9:21 ` Chander Kashyap
2012-09-18 4:17 ` Thomas Abraham
0 siblings, 2 replies; 4+ messages in thread
From: Chander Kashyap @ 2012-09-06 14:25 UTC (permalink / raw)
To: linux-arm-kernel
The clock instance parameter in Samsung clock interface is not being checked
for NULL pointers. Add checks for NULL pointers.
Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
---
arch/arm/plat-samsung/clock.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c
index 65c5eca..7938fbc 100644
--- a/arch/arm/plat-samsung/clock.c
+++ b/arch/arm/plat-samsung/clock.c
@@ -119,7 +119,7 @@ void clk_disable(struct clk *clk)
unsigned long clk_get_rate(struct clk *clk)
{
- if (IS_ERR(clk))
+ if (IS_ERR_OR_NULL(clk))
return 0;
if (clk->rate != 0)
@@ -136,7 +136,7 @@ unsigned long clk_get_rate(struct clk *clk)
long clk_round_rate(struct clk *clk, unsigned long rate)
{
- if (!IS_ERR(clk) && clk->ops && clk->ops->round_rate)
+ if (!IS_ERR_OR_NULL(clk) && clk->ops && clk->ops->round_rate)
return (clk->ops->round_rate)(clk, rate);
return rate;
@@ -146,7 +146,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
{
int ret;
- if (IS_ERR(clk))
+ if (IS_ERR_OR_NULL(clk))
return -EINVAL;
/* We do not default just do a clk->rate = rate as
@@ -175,7 +175,7 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
{
int ret = 0;
- if (IS_ERR(clk))
+ if (IS_ERR_OR_NULL(clk) || IS_ERR_OR_NULL(parent))
return -EINVAL;
spin_lock(&clocks_lock);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] ARM: SAMSUNG: Add check for NULL in clock interface
2012-09-06 14:25 [PATCH 2/2] ARM: SAMSUNG: Add check for NULL in clock interface Chander Kashyap
@ 2012-09-14 9:21 ` Chander Kashyap
2012-09-18 4:17 ` Thomas Abraham
1 sibling, 0 replies; 4+ messages in thread
From: Chander Kashyap @ 2012-09-14 9:21 UTC (permalink / raw)
To: linux-arm-kernel
ping
On 6 September 2012 19:55, Chander Kashyap <chander.kashyap@linaro.org> wrote:
> The clock instance parameter in Samsung clock interface is not being checked
> for NULL pointers. Add checks for NULL pointers.
>
> Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
> ---
> arch/arm/plat-samsung/clock.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c
> index 65c5eca..7938fbc 100644
> --- a/arch/arm/plat-samsung/clock.c
> +++ b/arch/arm/plat-samsung/clock.c
> @@ -119,7 +119,7 @@ void clk_disable(struct clk *clk)
>
> unsigned long clk_get_rate(struct clk *clk)
> {
> - if (IS_ERR(clk))
> + if (IS_ERR_OR_NULL(clk))
> return 0;
>
> if (clk->rate != 0)
> @@ -136,7 +136,7 @@ unsigned long clk_get_rate(struct clk *clk)
>
> long clk_round_rate(struct clk *clk, unsigned long rate)
> {
> - if (!IS_ERR(clk) && clk->ops && clk->ops->round_rate)
> + if (!IS_ERR_OR_NULL(clk) && clk->ops && clk->ops->round_rate)
> return (clk->ops->round_rate)(clk, rate);
>
> return rate;
> @@ -146,7 +146,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
> {
> int ret;
>
> - if (IS_ERR(clk))
> + if (IS_ERR_OR_NULL(clk))
> return -EINVAL;
>
> /* We do not default just do a clk->rate = rate as
> @@ -175,7 +175,7 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
> {
> int ret = 0;
>
> - if (IS_ERR(clk))
> + if (IS_ERR_OR_NULL(clk) || IS_ERR_OR_NULL(parent))
> return -EINVAL;
>
> spin_lock(&clocks_lock);
> --
> 1.7.9.5
>
--
with warm regards,
Chander Kashyap
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] ARM: SAMSUNG: Add check for NULL in clock interface
2012-09-06 14:25 [PATCH 2/2] ARM: SAMSUNG: Add check for NULL in clock interface Chander Kashyap
2012-09-14 9:21 ` Chander Kashyap
@ 2012-09-18 4:17 ` Thomas Abraham
2012-09-19 23:22 ` Kukjin Kim
1 sibling, 1 reply; 4+ messages in thread
From: Thomas Abraham @ 2012-09-18 4:17 UTC (permalink / raw)
To: linux-arm-kernel
On 6 September 2012 19:55, Chander Kashyap <chander.kashyap@linaro.org> wrote:
> The clock instance parameter in Samsung clock interface is not being checked
> for NULL pointers. Add checks for NULL pointers.
>
> Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
> ---
> arch/arm/plat-samsung/clock.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c
> index 65c5eca..7938fbc 100644
> --- a/arch/arm/plat-samsung/clock.c
> +++ b/arch/arm/plat-samsung/clock.c
> @@ -119,7 +119,7 @@ void clk_disable(struct clk *clk)
>
> unsigned long clk_get_rate(struct clk *clk)
> {
> - if (IS_ERR(clk))
> + if (IS_ERR_OR_NULL(clk))
> return 0;
>
> if (clk->rate != 0)
> @@ -136,7 +136,7 @@ unsigned long clk_get_rate(struct clk *clk)
>
> long clk_round_rate(struct clk *clk, unsigned long rate)
> {
> - if (!IS_ERR(clk) && clk->ops && clk->ops->round_rate)
> + if (!IS_ERR_OR_NULL(clk) && clk->ops && clk->ops->round_rate)
> return (clk->ops->round_rate)(clk, rate);
>
> return rate;
> @@ -146,7 +146,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
> {
> int ret;
>
> - if (IS_ERR(clk))
> + if (IS_ERR_OR_NULL(clk))
> return -EINVAL;
>
> /* We do not default just do a clk->rate = rate as
> @@ -175,7 +175,7 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
> {
> int ret = 0;
>
> - if (IS_ERR(clk))
> + if (IS_ERR_OR_NULL(clk) || IS_ERR_OR_NULL(parent))
> return -EINVAL;
>
> spin_lock(&clocks_lock);
> --
> 1.7.9.5
Acked-by: Thomas Abraham <thomas.abraham@linaro.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] ARM: SAMSUNG: Add check for NULL in clock interface
2012-09-18 4:17 ` Thomas Abraham
@ 2012-09-19 23:22 ` Kukjin Kim
0 siblings, 0 replies; 4+ messages in thread
From: Kukjin Kim @ 2012-09-19 23:22 UTC (permalink / raw)
To: linux-arm-kernel
Thomas Abraham wrote:
>
> On 6 September 2012 19:55, Chander Kashyap <chander.kashyap@linaro.org>
> wrote:
> > The clock instance parameter in Samsung clock interface is not being
> checked
> > for NULL pointers. Add checks for NULL pointers.
> >
> > Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
> > ---
> > arch/arm/plat-samsung/clock.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-
> samsung/clock.c
> > index 65c5eca..7938fbc 100644
> > --- a/arch/arm/plat-samsung/clock.c
> > +++ b/arch/arm/plat-samsung/clock.c
> > @@ -119,7 +119,7 @@ void clk_disable(struct clk *clk)
> >
> > unsigned long clk_get_rate(struct clk *clk)
> > {
> > - if (IS_ERR(clk))
> > + if (IS_ERR_OR_NULL(clk))
> > return 0;
> >
> > if (clk->rate != 0)
> > @@ -136,7 +136,7 @@ unsigned long clk_get_rate(struct clk *clk)
> >
> > long clk_round_rate(struct clk *clk, unsigned long rate)
> > {
> > - if (!IS_ERR(clk) && clk->ops && clk->ops->round_rate)
> > + if (!IS_ERR_OR_NULL(clk) && clk->ops && clk->ops->round_rate)
> > return (clk->ops->round_rate)(clk, rate);
> >
> > return rate;
> > @@ -146,7 +146,7 @@ int clk_set_rate(struct clk *clk, unsigned long
rate)
> > {
> > int ret;
> >
> > - if (IS_ERR(clk))
> > + if (IS_ERR_OR_NULL(clk))
> > return -EINVAL;
> >
> > /* We do not default just do a clk->rate = rate as
> > @@ -175,7 +175,7 @@ int clk_set_parent(struct clk *clk, struct clk
> *parent)
> > {
> > int ret = 0;
> >
> > - if (IS_ERR(clk))
> > + if (IS_ERR_OR_NULL(clk) || IS_ERR_OR_NULL(parent))
> > return -EINVAL;
> >
> > spin_lock(&clocks_lock);
> > --
> > 1.7.9.5
>
> Acked-by: Thomas Abraham <thomas.abraham@linaro.org>
Looks OK, will apply.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-09-19 23:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-06 14:25 [PATCH 2/2] ARM: SAMSUNG: Add check for NULL in clock interface Chander Kashyap
2012-09-14 9:21 ` Chander Kashyap
2012-09-18 4:17 ` Thomas Abraham
2012-09-19 23:22 ` Kukjin Kim
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).