diff mbox

[stable,3.18] fix __unflatten_device_tree warning

Message ID 20170524143001.1678102-1-arnd@arndb.de
State New
Headers show

Commit Message

Arnd Bergmann May 24, 2017, 2:30 p.m. UTC
A backported patch needs to be modified for a context change

drivers/of/fdt.c:384:10: warning: 'return' with a value, in function returning void

Fixes: 0aa459efa045 ("of: fdt: add missing allocation-failure check")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 drivers/of/fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.9.0

Comments

Greg Kroah-Hartman May 24, 2017, 3:07 p.m. UTC | #1
On Wed, May 24, 2017 at 04:30:01PM +0200, Arnd Bergmann wrote:
> A backported patch needs to be modified for a context change

> 

> drivers/of/fdt.c:384:10: warning: 'return' with a value, in function returning void

> 

> Fixes: 0aa459efa045 ("of: fdt: add missing allocation-failure check")

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> ---

>  drivers/of/fdt.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c

> index e706bced9b6b..74c7aba476f6 100644

> --- a/drivers/of/fdt.c

> +++ b/drivers/of/fdt.c

> @@ -381,7 +381,7 @@ static void __unflatten_device_tree(void *blob,

>  	/* Allocate memory for the expanded device tree */

>  	mem = dt_alloc(size + 4, __alignof__(struct device_node));

>  	if (!mem)

> -		return NULL;

> +		return;

>  

>  	memset(mem, 0, size);

>  


Ah, this is still in a patch that I have not released yet, nice!  I've
now flattened this with the original one, many thanks for it.

greg k-h
diff mbox

Patch

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index e706bced9b6b..74c7aba476f6 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -381,7 +381,7 @@  static void __unflatten_device_tree(void *blob,
 	/* Allocate memory for the expanded device tree */
 	mem = dt_alloc(size + 4, __alignof__(struct device_node));
 	if (!mem)
-		return NULL;
+		return;
 
 	memset(mem, 0, size);