x86: amd_iommu_init.c use NULL pointer
PATCH 1/1 x86: amd_iommu_init.c use NULL pointer
Signed-off-by Jaswinder Singh Rajput <[email protected]>
--- arch/x86/kernel/amd_iommu_init.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/amd_iommu_init.c +1 -1
@@ -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 )
Signature · 1 line
1.6.0.6
Quoted 20 lines · Jaswinder Singh Rajput
Signed-off-by Jaswinder Singh Rajput <[email protected]>--- arch/x86/kernel/amd_iommu_init.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/x86/kernel/amd_iommu_init.c +1
-1@@ -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 );
Quoted 4 lines
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.
Quoted 20 lines · Cyrill Gorcunov
Quoted 19 lines · Jaswinder Singh Rajput
Signed-off-by Jaswinder Singh Rajput <[email protected]>--- arch/x86/kernel/amd_iommu_init.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/x86/kernel/amd_iommu_init.c +1
-1@@ -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 ;
Quoted 8 lines
Quoted 5 lines
arch/x86/kernel/amd_iommu_init.c +0
-0e =kzalloc (sizeof (*e),GFP_KERNEL );if (e == NULL)
--
1.6.0.6Hi 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 <[email protected]>
--- arch/x86/kernel/amd_iommu_init.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/amd_iommu_init.c +1 -1
@@ -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 )
Signature · 1 line
1.6.0.6