linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] release_resource() check for NULL resource
@ 2005-10-02 17:03 Ben Dooks
  2005-10-02 17:39 ` Randy.Dunlap
  0 siblings, 1 reply; 18+ messages in thread
From: Ben Dooks @ 2005-10-02 17:03 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 508 bytes --]

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

Signed-off-by: Ben Dooks <ben-linux@fluff.org>

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;

[-- Attachment #2: resource-release-null.patch --]
[-- Type: text/plain, Size: 389 bytes --]

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;

^ permalink raw reply	[flat|nested] 18+ messages in thread
[parent not found: <4TfvY-8ix-27@gated-at.bofh.it>]

end of thread, other threads:[~2005-10-05  9:07 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-02 17:03 [PATCH] release_resource() check for NULL resource Ben Dooks
2005-10-02 17:39 ` Randy.Dunlap
2005-10-03  9:48   ` Ben Dooks
2005-10-03  9:59     ` Jesper Juhl
2005-10-03 10:04       ` Russell King
2005-10-03 12:43         ` Pekka Enberg
2005-10-03 12:49           ` Russell King
2005-10-03 12:54             ` Pekka J Enberg
2005-10-03 13:00               ` Russell King
2005-10-03 13:12                 ` Pekka J Enberg
2005-10-03 13:42                   ` Russell King
2005-10-03 13:42           ` Al Viro
2005-10-03 14:57             ` Pekka Enberg
2005-10-04  2:15         ` Randy.Dunlap
     [not found]   ` <5dc44ec70510031959w1f4adfcbh395535ade34a357d@mail.gmail.com>
2005-10-04  3:00     ` Diego de Estrada
2005-10-04  3:28     ` Randy.Dunlap
     [not found] <4TfvY-8ix-27@gated-at.bofh.it>
     [not found] ` <4Tg8u-Bn-15@gated-at.bofh.it>
     [not found]   ` <4Tv7u-5Hd-15@gated-at.bofh.it>
     [not found]     ` <4TvB0-6wD-3@gated-at.bofh.it>
     [not found]       ` <4TvB7-6wD-5@gated-at.bofh.it>
     [not found]         ` <4TxWv-1xD-37@gated-at.bofh.it>
2005-10-04 22:31           ` Bodo Eggert
2005-10-05  9:06             ` Russell King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).