Commit 9ff8e5a0 authored by Pablo Menichini's avatar Pablo Menichini Committed by David S. Miller

[SPARC-ENVCTRL]: Handle failed kmalloc.

parent d1a2fd6a
...@@ -892,6 +892,10 @@ static void envctrl_init_i2c_child(struct linux_ebus_child *edev_child, ...@@ -892,6 +892,10 @@ static void envctrl_init_i2c_child(struct linux_ebus_child *edev_child,
} }
pchild->tables = kmalloc(tbls_size, GFP_KERNEL); pchild->tables = kmalloc(tbls_size, GFP_KERNEL);
if (pchild->tables == NULL){
printk("envctrl: Failed to allocate table.\n");
return;
}
len = prom_getproperty(node, "tables", len = prom_getproperty(node, "tables",
(char *) pchild->tables, tbls_size); (char *) pchild->tables, tbls_size);
if (len <= 0) { if (len <= 0) {
......
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