2.1.35: NULL pointer dereference in buffer.c (find_candidates)

Jaromir Koutek (miri@atrey.karlin.mff.cuni.cz)
Wed, 23 Apr 1997 17:44:36 +0200 (MET DST)


I get at heavy I/O this "warning", it is in buffer.c, function
find_candidate:
for (bh = list;
bh && (*list_len) > 0;
bh = bh->b_next_free, (*list_len)--) {
^^^^^^^^^^^^^^^ HERE. bh==NULL
[... no change of bh ...] }
I can't imagine why this do not work. I didn't belive this. But messages
are clear (c012e1d0 is movl 24(%eax),%eax ~ bh=bh->b_next_free):
Unable to handle kernel NULL pointer dereference at virtual address
00000018
current->tss.cr3 = 00db5000, Lr3 = 00db5000
*pde = 00000000
Oops: 0000
CPU: 0
EIP: 0010:[<c012e1d0>]
EFLAGS: 00010292
eax: 00000000 ebx: c0790e10 ecx: 00000000 edx: c01ab924
esi: 00000400 edi: 0000e000 ebp: 00000400 esp: c0790de0
ds: 0018 es: 0018 ss: 0018
Process mc (pid: 1049, process nr: 50, stackpage=c0790000)

I changed it to, so far (2 hours...) without problem:
for (bh = list;
bh && (*list_len) > 0;
bh = ((bh == NULL)? NULL : bh->b_next_free), (*list_len)--) {