[PATCH] release_resource() check for NULL resource

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

 



If release_resource() is passed a NULL resource
the kernel will OOPS.

Signed-off-by: Ben Dooks <[email protected]>

diff -urN -X ../dontdiff linux-2.6.14-rc3/kernel/resource.c linux-2.6.14-rc3-bjd1/kernel/resource.c
--- linux-2.6.14-rc3/kernel/resource.c	2005-10-02 12:58:03.000000000 +0100
+++ linux-2.6.14-rc3-bjd1/kernel/resource.c	2005-10-02 17:58:09.000000000 +0100
@@ -181,6 +181,9 @@
 {
 	struct resource *tmp, **p;
 
+	if (!old)
+		return 0;
+
 	p = &old->parent->child;
 	for (;;) {
 		tmp = *p;
diff -urN -X ../dontdiff linux-2.6.14-rc3/kernel/resource.c linux-2.6.14-rc3-bjd1/kernel/resource.c
--- linux-2.6.14-rc3/kernel/resource.c	2005-10-02 12:58:03.000000000 +0100
+++ linux-2.6.14-rc3-bjd1/kernel/resource.c	2005-10-02 17:58:09.000000000 +0100
@@ -181,6 +181,9 @@
 {
 	struct resource *tmp, **p;
 
+	if (!old)
+		return 0;
+
 	p = &old->parent->child;
 	for (;;) {
 		tmp = *p;

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux