public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -tip] x86: amd_iommu_init.c use NULL pointer
@ 2009-05-13 22:27 Jaswinder Singh Rajput
  2009-05-14  3:00 ` Cyrill Gorcunov
  0 siblings, 1 reply; 3+ messages in thread
From: Jaswinder Singh Rajput @ 2009-05-13 22:27 UTC (permalink / raw)
  To: Ingo Molnar, Joerg Roedel, x86 maintainers, LKML


Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
 arch/x86/kernel/amd_iommu_init.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index 8c0be09..f728b12 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -898,7 +898,7 @@ static int __init init_exclusion_range(struct ivmd_header *m)
 /* called for unity map ACPI definition */
 static int __init init_unity_map_range(struct ivmd_header *m)
 {
-	struct unity_map_entry *e = 0;
+	struct unity_map_entry *e = NULL;
 
 	e = kzalloc(sizeof(*e), GFP_KERNEL);
 	if (e == NULL)
-- 
1.6.0.6




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

* Re: [PATCH -tip] x86: amd_iommu_init.c use NULL pointer
  2009-05-13 22:27 [PATCH -tip] x86: amd_iommu_init.c use NULL pointer Jaswinder Singh Rajput
@ 2009-05-14  3:00 ` Cyrill Gorcunov
  2009-05-14  4:37   ` Jaswinder Singh Rajput
  0 siblings, 1 reply; 3+ messages in thread
From: Cyrill Gorcunov @ 2009-05-14  3:00 UTC (permalink / raw)
  To: Jaswinder Singh Rajput; +Cc: Ingo Molnar, Joerg Roedel, x86 maintainers, LKML

On 5/14/09, Jaswinder Singh Rajput <jaswinder@kernel.org> wrote:
>
> Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
> ---
>  arch/x86/kernel/amd_iommu_init.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kernel/amd_iommu_init.c
> b/arch/x86/kernel/amd_iommu_init.c
> index 8c0be09..f728b12 100644
> --- a/arch/x86/kernel/amd_iommu_init.c
> +++ b/arch/x86/kernel/amd_iommu_init.c
> @@ -898,7 +898,7 @@ static int __init init_exclusion_range(struct
> ivmd_header *m)
>  /* called for unity map ACPI definition */
>  static int __init init_unity_map_range(struct ivmd_header *m)
>  {
> -	struct unity_map_entry *e = 0;
> +	struct unity_map_entry *e = NULL;
>
>  	e = kzalloc(sizeof(*e), GFP_KERNEL);
>  	if (e == NULL)
> --
> 1.6.0.6
>
Hi Jaswinder,
I believe you could get rid of such init completely. We do check 'e'
after kzalloc anyway.

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

* Re: [PATCH -tip] x86: amd_iommu_init.c use NULL pointer
  2009-05-14  3:00 ` Cyrill Gorcunov
@ 2009-05-14  4:37   ` Jaswinder Singh Rajput
  0 siblings, 0 replies; 3+ messages in thread
From: Jaswinder Singh Rajput @ 2009-05-14  4:37 UTC (permalink / raw)
  To: Cyrill Gorcunov; +Cc: Ingo Molnar, Joerg Roedel, x86 maintainers, LKML

On Thu, 2009-05-14 at 07:00 +0400, Cyrill Gorcunov wrote:
> On 5/14/09, Jaswinder Singh Rajput <jaswinder@kernel.org> wrote:
> >
> > Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
> > ---
> >  arch/x86/kernel/amd_iommu_init.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/x86/kernel/amd_iommu_init.c
> > b/arch/x86/kernel/amd_iommu_init.c
> > index 8c0be09..f728b12 100644
> > --- a/arch/x86/kernel/amd_iommu_init.c
> > +++ b/arch/x86/kernel/amd_iommu_init.c
> > @@ -898,7 +898,7 @@ static int __init init_exclusion_range(struct
> > ivmd_header *m)
> >  /* called for unity map ACPI definition */
> >  static int __init init_unity_map_range(struct ivmd_header *m)
> >  {
> > -	struct unity_map_entry *e = 0;
> > +	struct unity_map_entry *e = NULL;
> >
> >  	e = kzalloc(sizeof(*e), GFP_KERNEL);
> >  	if (e == NULL)
> > --
> > 1.6.0.6
> >
> Hi Jaswinder,
> I believe you could get rid of such init completely. We do check 'e'
> after kzalloc anyway.

Thanks, here is another patch:

[PATCH -tip] x86: amd_iommu_init.c fix initialization issue

struct unity_map_entry *e = 0 which should be struct unity_map_entry *e = NULL

But we do not need to initialize e as kzalloc will take care of it.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
 arch/x86/kernel/amd_iommu_init.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index 8c0be09..1ca0383 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -898,7 +898,7 @@ static int __init init_exclusion_range(struct ivmd_header *m)
 /* called for unity map ACPI definition */
 static int __init init_unity_map_range(struct ivmd_header *m)
 {
-	struct unity_map_entry *e = 0;
+	struct unity_map_entry *e;
 
 	e = kzalloc(sizeof(*e), GFP_KERNEL);
 	if (e == NULL)
-- 
1.6.0.6




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

end of thread, other threads:[~2009-05-14  4:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-13 22:27 [PATCH -tip] x86: amd_iommu_init.c use NULL pointer Jaswinder Singh Rajput
2009-05-14  3:00 ` Cyrill Gorcunov
2009-05-14  4:37   ` Jaswinder Singh Rajput

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox