Commit 0c080cee authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'devicetree-fixes-for-4.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux

Pull DeviceTree fixes from Rob Herring:

 - Fix memory leak in error case of of_console_check

 - Increase number of reserved memory regions to 32. 16 was not enough
   on some Power systems.

 - Fix OF node refcounting for of_fwnode_graph_get_port_parent

* tag 'devicetree-fixes-for-4.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  device property: preserve usecount for node passed to of_fwnode_graph_get_port_parent()
  drivers: of: increase MAX_RESERVED_REGIONS to 32
  of: do not leak console options
parents e18e8844 3314c6bd
...@@ -1781,8 +1781,12 @@ bool of_console_check(struct device_node *dn, char *name, int index) ...@@ -1781,8 +1781,12 @@ bool of_console_check(struct device_node *dn, char *name, int index)
{ {
if (!dn || dn != of_stdout || console_set_on_cmdline) if (!dn || dn != of_stdout || console_set_on_cmdline)
return false; return false;
return !add_preferred_console(name, index,
kstrdup(of_stdout_options, GFP_KERNEL)); /*
* XXX: cast `options' to char pointer to suppress complication
* warnings: printk, UART and console drivers expect char pointer.
*/
return !add_preferred_console(name, index, (char *)of_stdout_options);
} }
EXPORT_SYMBOL_GPL(of_console_check); EXPORT_SYMBOL_GPL(of_console_check);
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <linux/sort.h> #include <linux/sort.h>
#include <linux/slab.h> #include <linux/slab.h>
#define MAX_RESERVED_REGIONS 16 #define MAX_RESERVED_REGIONS 32
static struct reserved_mem reserved_mem[MAX_RESERVED_REGIONS]; static struct reserved_mem reserved_mem[MAX_RESERVED_REGIONS];
static int reserved_mem_count; static int reserved_mem_count;
......
...@@ -954,7 +954,7 @@ of_fwnode_graph_get_port_parent(struct fwnode_handle *fwnode) ...@@ -954,7 +954,7 @@ of_fwnode_graph_get_port_parent(struct fwnode_handle *fwnode)
struct device_node *np; struct device_node *np;
/* Get the parent of the port */ /* Get the parent of the port */
np = of_get_next_parent(to_of_node(fwnode)); np = of_get_parent(to_of_node(fwnode));
if (!np) if (!np)
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment