All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] ARM: mvebu: potential dereference of null pointer
@ 2023-01-21  1:37 kernel test robot
  0 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2023-01-21  1:37 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Julia Lawall

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <202301191051184033370@zte.com.cn>
References: <202301191051184033370@zte.com.cn>
TO: ye.xingchen@zte.com.cn
TO: andrew@lunn.ch
CC: gregory.clement@bootlin.com
CC: sebastian.hesselbarth@gmail.com
CC: linux@armlinux.org.uk
CC: linux-arm-kernel@lists.infradead.org
CC: linux-kernel@vger.kernel.org

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on soc/for-next]
[also build test WARNING on linus/master v6.2-rc4 next-20230120]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/ye-xingchen-zte-com-cn/ARM-mvebu-potential-dereference-of-null-pointer/20230119-105239
base:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
patch link:    https://lore.kernel.org/r/202301191051184033370%40zte.com.cn
patch subject: [PATCH] ARM: mvebu: potential dereference of null pointer
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: arm-randconfig-c032-20230119 (https://download.01.org/0day-ci/archive/20230121/202301210926.eZarSBqd-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Julia Lawall <julia.lawall@lip6.fr>

cocci warnings: (new ones prefixed by >>)
>> arch/arm/mach-mvebu/board-v7.c:124:1-25: WARNING: Function "for_each_compatible_node" should have of_node_put() before return around line 129.
   arch/arm/mach-mvebu/board-v7.c:124:1-25: WARNING: Function "for_each_compatible_node" should have of_node_put() before return around line 136.
--
>> arch/arm/mach-mvebu/coherency.c:190:1-25: WARNING: Function "for_each_compatible_node" should have of_node_put() before return around line 195.
   arch/arm/mach-mvebu/coherency.c:190:1-25: WARNING: Function "for_each_compatible_node" should have of_node_put() before return around line 198.

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

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

* Re: [PATCH] ARM: mvebu: potential dereference of null pointer
  2023-01-19  2:51 ` ye.xingchen
@ 2023-01-19 18:01   ` Russell King (Oracle)
  -1 siblings, 0 replies; 11+ messages in thread
From: Russell King (Oracle) @ 2023-01-19 18:01 UTC (permalink / raw)
  To: ye.xingchen
  Cc: andrew, gregory.clement, sebastian.hesselbarth, linux-arm-kernel,
	linux-kernel

On Thu, Jan 19, 2023 at 10:51:18AM +0800, ye.xingchen@zte.com.cn wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> The return value of kzalloc() needs to be checked.
> To avoid use of null pointer in case of the failure of alloc.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
> ---
>  arch/arm/mach-mvebu/board-v7.c  | 4 ++++
>  arch/arm/mach-mvebu/coherency.c | 4 ++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c
> index fd5d0c8ff695..3c031b2efe16 100644
> --- a/arch/arm/mach-mvebu/board-v7.c
> +++ b/arch/arm/mach-mvebu/board-v7.c
> @@ -125,11 +125,15 @@ static void __init i2c_quirk(void)
>  		struct property *new_compat;
> 
>  		new_compat = kzalloc(sizeof(*new_compat), GFP_KERNEL);
> +		if (!new_compat)
> +			return;
> 
>  		new_compat->name = kstrdup("compatible", GFP_KERNEL);
>  		new_compat->length = sizeof("marvell,mv78230-a0-i2c");
>  		new_compat->value = kstrdup("marvell,mv78230-a0-i2c",
>  						GFP_KERNEL);
> +		if (!new_compat->name || !new_compat->value)
> +			return;

... and then someone else comes along and spots that "new_compat"
gets leaked, so we get another patch to add a kfree() for new_compat.

Why not do the job properly first time around?

>  		of_update_property(np, new_compat);
>  	}
> diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c
> index a6b621ff0b87..8291185c52cc 100644
> --- a/arch/arm/mach-mvebu/coherency.c
> +++ b/arch/arm/mach-mvebu/coherency.c
> @@ -191,7 +191,11 @@ static void __init armada_375_380_coherency_init(struct device_node *np)
>  		struct property *p;
> 
>  		p = kzalloc(sizeof(*p), GFP_KERNEL);
> +		if (!p)
> +			return;
>  		p->name = kstrdup("arm,io-coherent", GFP_KERNEL);
> +		if (!p->name)
> +			return;

Same problem here.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

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

* Re: [PATCH] ARM: mvebu: potential dereference of null pointer
@ 2023-01-19 18:01   ` Russell King (Oracle)
  0 siblings, 0 replies; 11+ messages in thread
From: Russell King (Oracle) @ 2023-01-19 18:01 UTC (permalink / raw)
  To: ye.xingchen
  Cc: andrew, gregory.clement, sebastian.hesselbarth, linux-arm-kernel,
	linux-kernel

On Thu, Jan 19, 2023 at 10:51:18AM +0800, ye.xingchen@zte.com.cn wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> The return value of kzalloc() needs to be checked.
> To avoid use of null pointer in case of the failure of alloc.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
> ---
>  arch/arm/mach-mvebu/board-v7.c  | 4 ++++
>  arch/arm/mach-mvebu/coherency.c | 4 ++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c
> index fd5d0c8ff695..3c031b2efe16 100644
> --- a/arch/arm/mach-mvebu/board-v7.c
> +++ b/arch/arm/mach-mvebu/board-v7.c
> @@ -125,11 +125,15 @@ static void __init i2c_quirk(void)
>  		struct property *new_compat;
> 
>  		new_compat = kzalloc(sizeof(*new_compat), GFP_KERNEL);
> +		if (!new_compat)
> +			return;
> 
>  		new_compat->name = kstrdup("compatible", GFP_KERNEL);
>  		new_compat->length = sizeof("marvell,mv78230-a0-i2c");
>  		new_compat->value = kstrdup("marvell,mv78230-a0-i2c",
>  						GFP_KERNEL);
> +		if (!new_compat->name || !new_compat->value)
> +			return;

... and then someone else comes along and spots that "new_compat"
gets leaked, so we get another patch to add a kfree() for new_compat.

Why not do the job properly first time around?

>  		of_update_property(np, new_compat);
>  	}
> diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c
> index a6b621ff0b87..8291185c52cc 100644
> --- a/arch/arm/mach-mvebu/coherency.c
> +++ b/arch/arm/mach-mvebu/coherency.c
> @@ -191,7 +191,11 @@ static void __init armada_375_380_coherency_init(struct device_node *np)
>  		struct property *p;
> 
>  		p = kzalloc(sizeof(*p), GFP_KERNEL);
> +		if (!p)
> +			return;
>  		p->name = kstrdup("arm,io-coherent", GFP_KERNEL);
> +		if (!p->name)
> +			return;

Same problem here.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ARM: mvebu: potential dereference of null pointer
  2023-01-19  2:51 ` ye.xingchen
@ 2023-01-19 13:38   ` Andrew Lunn
  -1 siblings, 0 replies; 11+ messages in thread
From: Andrew Lunn @ 2023-01-19 13:38 UTC (permalink / raw)
  To: ye.xingchen
  Cc: gregory.clement, sebastian.hesselbarth, linux, linux-arm-kernel,
	linux-kernel

On Thu, Jan 19, 2023 at 10:51:18AM +0800, ye.xingchen@zte.com.cn wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> The return value of kzalloc() needs to be checked.
> To avoid use of null pointer in case of the failure of alloc.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH] ARM: mvebu: potential dereference of null pointer
@ 2023-01-19 13:38   ` Andrew Lunn
  0 siblings, 0 replies; 11+ messages in thread
From: Andrew Lunn @ 2023-01-19 13:38 UTC (permalink / raw)
  To: ye.xingchen
  Cc: gregory.clement, sebastian.hesselbarth, linux, linux-arm-kernel,
	linux-kernel

On Thu, Jan 19, 2023 at 10:51:18AM +0800, ye.xingchen@zte.com.cn wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> The return value of kzalloc() needs to be checked.
> To avoid use of null pointer in case of the failure of alloc.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH] ARM: mvebu: potential dereference of null pointer
@ 2023-01-19  2:51 ` ye.xingchen
  0 siblings, 0 replies; 11+ messages in thread
From: ye.xingchen @ 2023-01-19  2:51 UTC (permalink / raw)
  To: andrew
  Cc: gregory.clement, sebastian.hesselbarth, linux, linux-arm-kernel,
	linux-kernel

From: Minghao Chi <chi.minghao@zte.com.cn>

The return value of kzalloc() needs to be checked.
To avoid use of null pointer in case of the failure of alloc.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
 arch/arm/mach-mvebu/board-v7.c  | 4 ++++
 arch/arm/mach-mvebu/coherency.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c
index fd5d0c8ff695..3c031b2efe16 100644
--- a/arch/arm/mach-mvebu/board-v7.c
+++ b/arch/arm/mach-mvebu/board-v7.c
@@ -125,11 +125,15 @@ static void __init i2c_quirk(void)
 		struct property *new_compat;

 		new_compat = kzalloc(sizeof(*new_compat), GFP_KERNEL);
+		if (!new_compat)
+			return;

 		new_compat->name = kstrdup("compatible", GFP_KERNEL);
 		new_compat->length = sizeof("marvell,mv78230-a0-i2c");
 		new_compat->value = kstrdup("marvell,mv78230-a0-i2c",
 						GFP_KERNEL);
+		if (!new_compat->name || !new_compat->value)
+			return;

 		of_update_property(np, new_compat);
 	}
diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c
index a6b621ff0b87..8291185c52cc 100644
--- a/arch/arm/mach-mvebu/coherency.c
+++ b/arch/arm/mach-mvebu/coherency.c
@@ -191,7 +191,11 @@ static void __init armada_375_380_coherency_init(struct device_node *np)
 		struct property *p;

 		p = kzalloc(sizeof(*p), GFP_KERNEL);
+		if (!p)
+			return;
 		p->name = kstrdup("arm,io-coherent", GFP_KERNEL);
+		if (!p->name)
+			return;
 		of_add_property(cache_dn, p);
 	}
 }
-- 
2.25.1

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

* [PATCH] ARM: mvebu: potential dereference of null pointer
@ 2023-01-19  2:51 ` ye.xingchen
  0 siblings, 0 replies; 11+ messages in thread
From: ye.xingchen @ 2023-01-19  2:51 UTC (permalink / raw)
  To: andrew
  Cc: gregory.clement, sebastian.hesselbarth, linux, linux-arm-kernel,
	linux-kernel

From: Minghao Chi <chi.minghao@zte.com.cn>

The return value of kzalloc() needs to be checked.
To avoid use of null pointer in case of the failure of alloc.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
 arch/arm/mach-mvebu/board-v7.c  | 4 ++++
 arch/arm/mach-mvebu/coherency.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c
index fd5d0c8ff695..3c031b2efe16 100644
--- a/arch/arm/mach-mvebu/board-v7.c
+++ b/arch/arm/mach-mvebu/board-v7.c
@@ -125,11 +125,15 @@ static void __init i2c_quirk(void)
 		struct property *new_compat;

 		new_compat = kzalloc(sizeof(*new_compat), GFP_KERNEL);
+		if (!new_compat)
+			return;

 		new_compat->name = kstrdup("compatible", GFP_KERNEL);
 		new_compat->length = sizeof("marvell,mv78230-a0-i2c");
 		new_compat->value = kstrdup("marvell,mv78230-a0-i2c",
 						GFP_KERNEL);
+		if (!new_compat->name || !new_compat->value)
+			return;

 		of_update_property(np, new_compat);
 	}
diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c
index a6b621ff0b87..8291185c52cc 100644
--- a/arch/arm/mach-mvebu/coherency.c
+++ b/arch/arm/mach-mvebu/coherency.c
@@ -191,7 +191,11 @@ static void __init armada_375_380_coherency_init(struct device_node *np)
 		struct property *p;

 		p = kzalloc(sizeof(*p), GFP_KERNEL);
+		if (!p)
+			return;
 		p->name = kstrdup("arm,io-coherent", GFP_KERNEL);
+		if (!p->name)
+			return;
 		of_add_property(cache_dn, p);
 	}
 }
-- 
2.25.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ARM: mvebu: potential dereference of null pointer
  2023-01-17 10:22 ` ye.xingchen
@ 2023-01-18 13:17   ` Andrew Lunn
  -1 siblings, 0 replies; 11+ messages in thread
From: Andrew Lunn @ 2023-01-18 13:17 UTC (permalink / raw)
  To: ye.xingchen
  Cc: gregory.clement, sebastian.hesselbarth, linux, linux-arm-kernel,
	linux-kernel, chi.minghao

On Tue, Jan 17, 2023 at 06:22:04PM +0800, ye.xingchen@zte.com.cn wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> The return value of kzalloc() needs to be checked.
> To avoid use of null pointer in case of the failure of alloc.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
> ---
>  arch/arm/mach-mvebu/board-v7.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c
> index fd5d0c8ff695..b93b4a8a8357 100644
> --- a/arch/arm/mach-mvebu/board-v7.c
> +++ b/arch/arm/mach-mvebu/board-v7.c
> @@ -125,7 +125,8 @@ static void __init i2c_quirk(void)
>  		struct property *new_compat;
> 
>  		new_compat = kzalloc(sizeof(*new_compat), GFP_KERNEL);
> -
> +		if (!new_compat)
> +			return;
>  		new_compat->name = kstrdup("compatible", GFP_KERNEL);
>  		new_compat->length = sizeof("marvell,mv78230-a0-i2c");
>  		new_compat->value = kstrdup("marvell,mv78230-a0-i2c",

Please add a blank line after the return statement.

Also, i find it interested your bot is telling you about kzalloc, but
totally ignoring kstrdup().

	Andrew

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ARM: mvebu: potential dereference of null pointer
@ 2023-01-18 13:17   ` Andrew Lunn
  0 siblings, 0 replies; 11+ messages in thread
From: Andrew Lunn @ 2023-01-18 13:17 UTC (permalink / raw)
  To: ye.xingchen
  Cc: gregory.clement, sebastian.hesselbarth, linux, linux-arm-kernel,
	linux-kernel, chi.minghao

On Tue, Jan 17, 2023 at 06:22:04PM +0800, ye.xingchen@zte.com.cn wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> The return value of kzalloc() needs to be checked.
> To avoid use of null pointer in case of the failure of alloc.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
> ---
>  arch/arm/mach-mvebu/board-v7.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c
> index fd5d0c8ff695..b93b4a8a8357 100644
> --- a/arch/arm/mach-mvebu/board-v7.c
> +++ b/arch/arm/mach-mvebu/board-v7.c
> @@ -125,7 +125,8 @@ static void __init i2c_quirk(void)
>  		struct property *new_compat;
> 
>  		new_compat = kzalloc(sizeof(*new_compat), GFP_KERNEL);
> -
> +		if (!new_compat)
> +			return;
>  		new_compat->name = kstrdup("compatible", GFP_KERNEL);
>  		new_compat->length = sizeof("marvell,mv78230-a0-i2c");
>  		new_compat->value = kstrdup("marvell,mv78230-a0-i2c",

Please add a blank line after the return statement.

Also, i find it interested your bot is telling you about kzalloc, but
totally ignoring kstrdup().

	Andrew

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

* [PATCH] ARM: mvebu: potential dereference of null pointer
@ 2023-01-17 10:22 ` ye.xingchen
  0 siblings, 0 replies; 11+ messages in thread
From: ye.xingchen @ 2023-01-17 10:22 UTC (permalink / raw)
  To: andrew
  Cc: gregory.clement, sebastian.hesselbarth, linux, linux-arm-kernel,
	linux-kernel, chi.minghao

From: Minghao Chi <chi.minghao@zte.com.cn>

The return value of kzalloc() needs to be checked.
To avoid use of null pointer in case of the failure of alloc.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
 arch/arm/mach-mvebu/board-v7.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c
index fd5d0c8ff695..b93b4a8a8357 100644
--- a/arch/arm/mach-mvebu/board-v7.c
+++ b/arch/arm/mach-mvebu/board-v7.c
@@ -125,7 +125,8 @@ static void __init i2c_quirk(void)
 		struct property *new_compat;

 		new_compat = kzalloc(sizeof(*new_compat), GFP_KERNEL);
-
+		if (!new_compat)
+			return;
 		new_compat->name = kstrdup("compatible", GFP_KERNEL);
 		new_compat->length = sizeof("marvell,mv78230-a0-i2c");
 		new_compat->value = kstrdup("marvell,mv78230-a0-i2c",
-- 
2.25.1

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

* [PATCH] ARM: mvebu: potential dereference of null pointer
@ 2023-01-17 10:22 ` ye.xingchen
  0 siblings, 0 replies; 11+ messages in thread
From: ye.xingchen @ 2023-01-17 10:22 UTC (permalink / raw)
  To: andrew
  Cc: gregory.clement, sebastian.hesselbarth, linux, linux-arm-kernel,
	linux-kernel, chi.minghao

From: Minghao Chi <chi.minghao@zte.com.cn>

The return value of kzalloc() needs to be checked.
To avoid use of null pointer in case of the failure of alloc.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
 arch/arm/mach-mvebu/board-v7.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c
index fd5d0c8ff695..b93b4a8a8357 100644
--- a/arch/arm/mach-mvebu/board-v7.c
+++ b/arch/arm/mach-mvebu/board-v7.c
@@ -125,7 +125,8 @@ static void __init i2c_quirk(void)
 		struct property *new_compat;

 		new_compat = kzalloc(sizeof(*new_compat), GFP_KERNEL);
-
+		if (!new_compat)
+			return;
 		new_compat->name = kstrdup("compatible", GFP_KERNEL);
 		new_compat->length = sizeof("marvell,mv78230-a0-i2c");
 		new_compat->value = kstrdup("marvell,mv78230-a0-i2c",
-- 
2.25.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-01-21  1:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-21  1:37 [PATCH] ARM: mvebu: potential dereference of null pointer kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2023-01-19  2:51 ye.xingchen
2023-01-19  2:51 ` ye.xingchen
2023-01-19 13:38 ` Andrew Lunn
2023-01-19 13:38   ` Andrew Lunn
2023-01-19 18:01 ` Russell King (Oracle)
2023-01-19 18:01   ` Russell King (Oracle)
2023-01-17 10:22 ye.xingchen
2023-01-17 10:22 ` ye.xingchen
2023-01-18 13:17 ` Andrew Lunn
2023-01-18 13:17   ` Andrew Lunn

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.