All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: S5PV210: Fix possible null pointer dereference.
@ 2011-05-13  7:03 ` Kukjin Kim
  0 siblings, 0 replies; 6+ messages in thread
From: Kukjin Kim @ 2011-05-13  7:03 UTC (permalink / raw)
  To: linux-arm-kernel, linux-samsung-soc; +Cc: ben-linux, Jonghwan Choi, Kukjin Kim

From: Jonghwan Choi <jhbird.choi@samsung.com>

Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
 arch/arm/mach-s5pv210/cpufreq.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-s5pv210/cpufreq.c b/arch/arm/mach-s5pv210/cpufreq.c
index 22046e2..58340ee 100644
--- a/arch/arm/mach-s5pv210/cpufreq.c
+++ b/arch/arm/mach-s5pv210/cpufreq.c
@@ -105,8 +105,10 @@ static void s5pv210_set_refresh(enum s5pv210_dmc_port ch, unsigned long freq)
 		reg = (S5P_VA_DMC0 + 0x30);
 	else if (ch == DMC1)
 		reg = (S5P_VA_DMC1 + 0x30);
-	else
+	else {
 		printk(KERN_ERR "Cannot find DMC port\n");
+		return;
+	}
 
 	/* Find current DRAM frequency */
 	tmp = s5pv210_dram_conf[ch].freq;
-- 
1.7.1

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

* [PATCH] ARM: S5PV210: Fix possible null pointer dereference.
@ 2011-05-13  7:03 ` Kukjin Kim
  0 siblings, 0 replies; 6+ messages in thread
From: Kukjin Kim @ 2011-05-13  7:03 UTC (permalink / raw)
  To: linux-arm-kernel

From: Jonghwan Choi <jhbird.choi@samsung.com>

Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
 arch/arm/mach-s5pv210/cpufreq.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-s5pv210/cpufreq.c b/arch/arm/mach-s5pv210/cpufreq.c
index 22046e2..58340ee 100644
--- a/arch/arm/mach-s5pv210/cpufreq.c
+++ b/arch/arm/mach-s5pv210/cpufreq.c
@@ -105,8 +105,10 @@ static void s5pv210_set_refresh(enum s5pv210_dmc_port ch, unsigned long freq)
 		reg = (S5P_VA_DMC0 + 0x30);
 	else if (ch == DMC1)
 		reg = (S5P_VA_DMC1 + 0x30);
-	else
+	else {
 		printk(KERN_ERR "Cannot find DMC port\n");
+		return;
+	}
 
 	/* Find current DRAM frequency */
 	tmp = s5pv210_dram_conf[ch].freq;
-- 
1.7.1

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

* Re: [PATCH] ARM: S5PV210: Fix possible null pointer dereference.
  2011-05-13  7:03 ` Kukjin Kim
@ 2011-05-13 11:43   ` Sergei Shtylyov
  -1 siblings, 0 replies; 6+ messages in thread
From: Sergei Shtylyov @ 2011-05-13 11:43 UTC (permalink / raw)
  To: Kukjin Kim; +Cc: linux-arm-kernel, linux-samsung-soc, Jonghwan Choi, ben-linux

Hello.

On 13-05-2011 11:03, Kukjin Kim wrote:

> From: Jonghwan Choi<jhbird.choi@samsung.com>

> Signed-off-by: Jonghwan Choi<jhbird.choi@samsung.com>
> Signed-off-by: Kukjin Kim<kgene.kim@samsung.com>
> ---
>   arch/arm/mach-s5pv210/cpufreq.c |    4 +++-
>   1 files changed, 3 insertions(+), 1 deletions(-)

> diff --git a/arch/arm/mach-s5pv210/cpufreq.c b/arch/arm/mach-s5pv210/cpufreq.c
> index 22046e2..58340ee 100644
> --- a/arch/arm/mach-s5pv210/cpufreq.c
> +++ b/arch/arm/mach-s5pv210/cpufreq.c
> @@ -105,8 +105,10 @@ static void s5pv210_set_refresh(enum s5pv210_dmc_port ch, unsigned long freq)
>   		reg = (S5P_VA_DMC0 + 0x30);
>   	else if (ch == DMC1)
>   		reg = (S5P_VA_DMC1 + 0x30);
> -	else
> +	else {
>   		printk(KERN_ERR "Cannot find DMC port\n");
> +		return;
> +	}

    According to CodingStyle, other branches should now have {} too.

WBR, Sergei

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

* [PATCH] ARM: S5PV210: Fix possible null pointer dereference.
@ 2011-05-13 11:43   ` Sergei Shtylyov
  0 siblings, 0 replies; 6+ messages in thread
From: Sergei Shtylyov @ 2011-05-13 11:43 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 13-05-2011 11:03, Kukjin Kim wrote:

> From: Jonghwan Choi<jhbird.choi@samsung.com>

> Signed-off-by: Jonghwan Choi<jhbird.choi@samsung.com>
> Signed-off-by: Kukjin Kim<kgene.kim@samsung.com>
> ---
>   arch/arm/mach-s5pv210/cpufreq.c |    4 +++-
>   1 files changed, 3 insertions(+), 1 deletions(-)

> diff --git a/arch/arm/mach-s5pv210/cpufreq.c b/arch/arm/mach-s5pv210/cpufreq.c
> index 22046e2..58340ee 100644
> --- a/arch/arm/mach-s5pv210/cpufreq.c
> +++ b/arch/arm/mach-s5pv210/cpufreq.c
> @@ -105,8 +105,10 @@ static void s5pv210_set_refresh(enum s5pv210_dmc_port ch, unsigned long freq)
>   		reg = (S5P_VA_DMC0 + 0x30);
>   	else if (ch == DMC1)
>   		reg = (S5P_VA_DMC1 + 0x30);
> -	else
> +	else {
>   		printk(KERN_ERR "Cannot find DMC port\n");
> +		return;
> +	}

    According to CodingStyle, other branches should now have {} too.

WBR, Sergei

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

* RE: [PATCH] ARM: S5PV210: Fix possible null pointer dereference.
  2011-05-13 11:43   ` Sergei Shtylyov
@ 2011-05-16  4:56     ` Kukjin Kim
  -1 siblings, 0 replies; 6+ messages in thread
From: Kukjin Kim @ 2011-05-16  4:56 UTC (permalink / raw)
  To: 'Sergei Shtylyov'
  Cc: linux-arm-kernel, linux-samsung-soc, 'Jonghwan Choi',
	ben-linux

Sergei Shtylyov wrote:
> 
> Hello.
> 
Hi ;)

> On 13-05-2011 11:03, Kukjin Kim wrote:
> 
> > From: Jonghwan Choi<jhbird.choi@samsung.com>
> 
> > Signed-off-by: Jonghwan Choi<jhbird.choi@samsung.com>
> > Signed-off-by: Kukjin Kim<kgene.kim@samsung.com>
> > ---
> >   arch/arm/mach-s5pv210/cpufreq.c |    4 +++-
> >   1 files changed, 3 insertions(+), 1 deletions(-)
> 
> > diff --git a/arch/arm/mach-s5pv210/cpufreq.c b/arch/arm/mach-
> s5pv210/cpufreq.c
> > index 22046e2..58340ee 100644
> > --- a/arch/arm/mach-s5pv210/cpufreq.c
> > +++ b/arch/arm/mach-s5pv210/cpufreq.c
> > @@ -105,8 +105,10 @@ static void s5pv210_set_refresh(enum
> s5pv210_dmc_port ch, unsigned long freq)
> >   		reg = (S5P_VA_DMC0 + 0x30);
> >   	else if (ch == DMC1)
> >   		reg = (S5P_VA_DMC1 + 0x30);
> > -	else
> > +	else {
> >   		printk(KERN_ERR "Cannot find DMC port\n");
> > +		return;
> > +	}
> 
>     According to CodingStyle, other branches should now have {} too.
> 
Yes, you're right.

I updated its commit in my tree like following.

---
diff --git a/arch/arm/mach-s5pv210/cpufreq.c
b/arch/arm/mach-s5pv210/cpufreq.c
index 22046e2..153af8b 100644
--- a/arch/arm/mach-s5pv210/cpufreq.c
+++ b/arch/arm/mach-s5pv210/cpufreq.c
@@ -101,12 +101,14 @@ static void s5pv210_set_refresh(enum s5pv210_dmc_port
ch, unsigned long freq)
        unsigned long tmp, tmp1;
        void __iomem *reg = NULL;

-       if (ch == DMC0)
+       if (ch == DMC0) {
                reg = (S5P_VA_DMC0 + 0x30);
-       else if (ch == DMC1)
+       } else if (ch == DMC1) {
                reg = (S5P_VA_DMC1 + 0x30);
-       else
+       } else {
                printk(KERN_ERR "Cannot find DMC port\n");
+               return;
+       }

        /* Find current DRAM frequency */
        tmp = s5pv210_dram_conf[ch].freq;
---

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

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

* [PATCH] ARM: S5PV210: Fix possible null pointer dereference.
@ 2011-05-16  4:56     ` Kukjin Kim
  0 siblings, 0 replies; 6+ messages in thread
From: Kukjin Kim @ 2011-05-16  4:56 UTC (permalink / raw)
  To: linux-arm-kernel

Sergei Shtylyov wrote:
> 
> Hello.
> 
Hi ;)

> On 13-05-2011 11:03, Kukjin Kim wrote:
> 
> > From: Jonghwan Choi<jhbird.choi@samsung.com>
> 
> > Signed-off-by: Jonghwan Choi<jhbird.choi@samsung.com>
> > Signed-off-by: Kukjin Kim<kgene.kim@samsung.com>
> > ---
> >   arch/arm/mach-s5pv210/cpufreq.c |    4 +++-
> >   1 files changed, 3 insertions(+), 1 deletions(-)
> 
> > diff --git a/arch/arm/mach-s5pv210/cpufreq.c b/arch/arm/mach-
> s5pv210/cpufreq.c
> > index 22046e2..58340ee 100644
> > --- a/arch/arm/mach-s5pv210/cpufreq.c
> > +++ b/arch/arm/mach-s5pv210/cpufreq.c
> > @@ -105,8 +105,10 @@ static void s5pv210_set_refresh(enum
> s5pv210_dmc_port ch, unsigned long freq)
> >   		reg = (S5P_VA_DMC0 + 0x30);
> >   	else if (ch == DMC1)
> >   		reg = (S5P_VA_DMC1 + 0x30);
> > -	else
> > +	else {
> >   		printk(KERN_ERR "Cannot find DMC port\n");
> > +		return;
> > +	}
> 
>     According to CodingStyle, other branches should now have {} too.
> 
Yes, you're right.

I updated its commit in my tree like following.

---
diff --git a/arch/arm/mach-s5pv210/cpufreq.c
b/arch/arm/mach-s5pv210/cpufreq.c
index 22046e2..153af8b 100644
--- a/arch/arm/mach-s5pv210/cpufreq.c
+++ b/arch/arm/mach-s5pv210/cpufreq.c
@@ -101,12 +101,14 @@ static void s5pv210_set_refresh(enum s5pv210_dmc_port
ch, unsigned long freq)
        unsigned long tmp, tmp1;
        void __iomem *reg = NULL;

-       if (ch == DMC0)
+       if (ch == DMC0) {
                reg = (S5P_VA_DMC0 + 0x30);
-       else if (ch == DMC1)
+       } else if (ch == DMC1) {
                reg = (S5P_VA_DMC1 + 0x30);
-       else
+       } else {
                printk(KERN_ERR "Cannot find DMC port\n");
+               return;
+       }

        /* Find current DRAM frequency */
        tmp = s5pv210_dram_conf[ch].freq;
---

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

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

end of thread, other threads:[~2011-05-16  4:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-13  7:03 [PATCH] ARM: S5PV210: Fix possible null pointer dereference Kukjin Kim
2011-05-13  7:03 ` Kukjin Kim
2011-05-13 11:43 ` Sergei Shtylyov
2011-05-13 11:43   ` Sergei Shtylyov
2011-05-16  4:56   ` Kukjin Kim
2011-05-16  4:56     ` Kukjin Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.