mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zachary Amsden <zach@vmware.com>
To: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jens Axboe <axboe@suse.de>, Tejun Heo <htejun@hotmail.com>,
	Zachary Amsden <zach@vmware.com>
Subject: [PATCH 1/1] Elevator init fixes
Date: Mon, 7 Nov 2005 16:04:34 -0800	[thread overview]
Message-ID: <200511080004.jA804Y0Y020472@zach-dev.vmware.com> (raw)

I got a panic in the elevator code, backtrace :

Unable to handle kernel NULL pointer dereference at virtual address 00000060
..
EIP is at elevator_put+0x0/0x30 (null elevator_type passed)
..
elevator_init+0x38
blk_init_queu_node+0xc9
floppy_init+0xdb
do_initcalls+0x23
init+0x10a
init+0x0

Clearly if the kmalloc here fails, e->elevator_type is not yet set; this
appears to be the correct fix, but I think I probably hit the second case
due to a race condition.  Someone more familiar with the elevator code
should look at this more closely until I can determine if I can reproduce.

Signed-off-by: Zachary Amsden <zach@vmware.com>

Index: linux-2.6.14-zach-work/drivers/block/elevator.c
===================================================================
--- linux-2.6.14-zach-work.orig/drivers/block/elevator.c	2005-11-07 09:41:11.000000000 -0800
+++ linux-2.6.14-zach-work/drivers/block/elevator.c	2005-11-07 15:57:10.000000000 -0800
@@ -190,14 +190,14 @@ int elevator_init(request_queue_t *q, ch
 
 	eq = kmalloc(sizeof(struct elevator_queue), GFP_KERNEL);
 	if (!eq) {
-		elevator_put(e->elevator_type);
+		elevator_put(e);
 		return -ENOMEM;
 	}
 
 	ret = elevator_attach(q, e, eq);
 	if (ret) {
 		kfree(eq);
-		elevator_put(e->elevator_type);
+		elevator_put(e);
 	}
 
 	return ret;

                 reply	other threads:[~2005-11-08  0:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200511080004.jA804Y0Y020472@zach-dev.vmware.com \
    --to=zach@vmware.com \
    --cc=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=htejun@hotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome