lkml.org 
[lkml]   [1997]   [Jan]   [30]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateThu, 30 Jan 1997 02:03:50 -0500 (EST)
FromIon Badulescu <>
SubjectNULL pointer dereference in find_candidate
Hi all,

This is an old bug for which the fix hasn't made it into the kernel yet.
Basically, under certain conditions, try_to_free_buffer makes bh=NULL,
the next iteration of the for loop dereferences it and... oops! :-)

The following patch should fix it (thanks to Mark Hemment for pointing it 
out).

Ionut

--
  It is better to keep your mouth shut and be thought a fool,
            than to open it and remove all doubt.

--- linux-2.1.24/fs/buffer.c.old	Sun Jan 26 05:07:30 1997
+++ linux-2.1.24/fs/buffer.c	Thu Jan 30 01:40:06 1997
@@ -582,6 +582,8 @@
 			   of other sizes, this is necessary now that we
 			   no longer have the lav code. */
 			try_to_free_buffer(bh,&bh,1);
+			if (!bh)
+				break;
 			continue;
 		}
 

\
 
 \ /
  Last update: 2005-03-22 13:38    [from the cache]
©2003-2008