Re: [PATCH] Driver Core patches for 2.6.6

From: Greg KH
Date: Fri May 14 2004 - 18:32:40 EST


ChangeSet 1.1587.5.20, 2004/05/05 14:40:43-07:00, greg@xxxxxxxxx

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


drivers/base/map.c | 7 +++++++
1 files changed, 7 insertions(+)


diff -Nru a/drivers/base/map.c b/drivers/base/map.c
--- a/drivers/base/map.c Fri May 14 15:57:59 2004
+++ b/drivers/base/map.c Fri May 14 15:57:59 2004
@@ -138,6 +138,13 @@
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;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/