From patchwork Wed Apr 15 22:45:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 18427 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3FMjc7b023731 for ; Wed, 15 Apr 2009 22:45:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751689AbZDOWpi (ORCPT ); Wed, 15 Apr 2009 18:45:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751281AbZDOWpi (ORCPT ); Wed, 15 Apr 2009 18:45:38 -0400 Received: from mail.gmx.net ([213.165.64.20]:42880 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753296AbZDOWph (ORCPT ); Wed, 15 Apr 2009 18:45:37 -0400 Received: (qmail invoked by alias); 15 Apr 2009 22:45:35 -0000 Received: from mnhm-590d3329.pool.einsundeins.de (EHLO [192.168.178.60]) [89.13.51.41] by mail.gmx.net (mp022) with SMTP; 16 Apr 2009 00:45:35 +0200 X-Authenticated: #1045983 X-Provags-ID: V01U2FsdGVkX1/Y8IYQ+o/YNLnddbqNUgbH84luJHgHNUqBoJTg/j ucwa8rTohmQj+G Message-ID: <49E6638B.8090700@gmx.de> Date: Thu, 16 Apr 2009 00:45:31 +0200 From: Helge Deller User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Linus , Borislav Petkov , Bartlomiej Zolnierkiewicz , Kyle McMartin , linux-parisc , "Rafael J. Wysocki" Subject: [PATCH] ide-cd: fix kernel crash on hppa regression X-Enigmail-Version: 0.95.7 X-Y-GMX-Trusted: 0 X-FuHaFi: 0.44 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org With 2.6.30-rc2 I face a kernel crash on the 32bit hppa architecture due to ide-cd when udev creates the device nodes at startup: Kernel Fault: Code=26 regs=8ed34c40 (Addr=00000024) IASQ: 00000000 00000000 IAOQ: 1034b5ac 1034b5b0 IIR: 4ab30048 ISR: 00000000 IOR: 00000024 CPU: 0 CR30: 8ed34000 CR31: ffff55ff ORIG_R28: 00000000 IAOQ[0]: ide_complete_rq+0x2c/0x70 IAOQ[1]: ide_complete_rq+0x30/0x70 RP(r2): cdrom_newpc_intr+0x178/0x46c Backtrace: [<1035c608>] cdrom_newpc_intr+0x178/0x46c [<1034c494>] ide_intr+0x1b0/0x214 [<1016d284>] handle_IRQ_event+0x70/0x150 [<1016d4b0>] __do_IRQ+0x14c/0x1cc [<102f7864>] superio_interrupt+0x88/0xbc [<1016d284>] handle_IRQ_event+0x70/0x150 [<1016d4b0>] __do_IRQ+0x14c/0x1cc [<10112efc>] do_cpu_irq_mask+0x9c/0xd0 [<10116068>] intr_return+0x0/0x4 This crash seems to happen due to an uninitialized variable "rc". The compiler even warns about that: CC drivers/ide/ide-cd.o /mnt/sda4/home/cvs/parisc/git-kernel/linus-linux-2.6/drivers/ide/ide-cd.c: In function `cdrom_newpc_intr': /mnt/sda4/home/cvs/parisc/git-kernel/linus-linux-2.6/drivers/ide/ide-cd.c:612: warning: `rc' might be used uninitialized in this function After applying the trivial patch below, which just initializes the variable to zero, the kernel doesn't crash any longer: Starting the hotplug events dispatcher: udevd. Synthesizing the initial hotplug events... hda: command error: status=0x51 { DriveReady SeekComplete Error } hda: command error: error=0x54 <3>{ AbortedCommand LastFailedSense=0x05 } ide: failed opcode was: unknown done. Signed-off-by: Helge Deller Acked-by: Borislav Petkov --- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 3aec19d..3d4e099 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -609,7 +609,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) struct request *rq = hwif->rq; ide_expiry_t *expiry = NULL; int dma_error = 0, dma, thislen, uptodate = 0; - int write = (rq_data_dir(rq) == WRITE) ? 1 : 0, rc, nsectors; + int write = (rq_data_dir(rq) == WRITE) ? 1 : 0, rc = 0, nsectors; int sense = blk_sense_request(rq); unsigned int timeout; u16 len;