Commit 7a54ce54 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Driver core: handle error if we run out of memory in kmap code

parent 361f1a1a
......@@ -138,6 +138,13 @@ struct kobj_map *kobj_map_init(kobj_probe_t *base_probe,
struct kobj_map *p = kmalloc(sizeof(struct kobj_map), GFP_KERNEL);
struct probe *base = kmalloc(sizeof(struct probe), GFP_KERNEL);
int i;
if ((p == NULL) || (base == NULL)) {
kfree(p);
kfree(base);
return NULL;
}
memset(base, 0, sizeof(struct probe));
base->dev = 1;
base->range = ~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