[linux-4.1.y] Build warning from the commit 78de28c67c8f ("of: fdt: add missing allocation-failure check")

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

After applying the commit 78de28c67c8f ("of: fdt: add missing
allocation-failure check") to linux-4.1.y tree, there is build warning.

drivers/of/fdt.c: In function ‘__unflatten_device_tree’:
drivers/of/fdt.c:416:10: warning: ‘return’ with a value, in function
returning void
   return NULL;
          ^
drivers/of/fdt.c:381:13: note: declared here
 static void __unflatten_device_tree(void *blob,
             ^~~~~~~~~~~~~~~~~~~~~~~

It seems to be fixed as like following:
---
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index ae1b654..531b486 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -417,7 +417,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);



---

Best Regards,
- Seung-Woo Kim

-- 
Seung-Woo Kim
Samsung Software R&D Center
--




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]