From patchwork Tue Oct 23 10:17:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bugzilla-daemon@bugzilla.kernel.org X-Patchwork-Id: 193419 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 7AA832C0100 for ; Tue, 23 Oct 2012 21:18:05 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752825Ab2JWKSE (ORCPT ); Tue, 23 Oct 2012 06:18:04 -0400 Received: from mail.kernel.org ([198.145.19.201]:34854 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751637Ab2JWKSD (ORCPT ); Tue, 23 Oct 2012 06:18:03 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 470BF2034C for ; Tue, 23 Oct 2012 10:17:58 +0000 (UTC) Received: from bugzilla.kernel.org (bugzilla.kernel.org [198.145.19.217]) by mail.kernel.org (Postfix) with ESMTP id E1A9420346 for ; Tue, 23 Oct 2012 10:17:56 +0000 (UTC) Received: by bugzilla.kernel.org (Postfix, from userid 1000) id 91A7111FB3D; Tue, 23 Oct 2012 10:17:54 +0000 (UTC) From: bugzilla-daemon@bugzilla.kernel.org To: linux-ide@vger.kernel.org Subject: [Bug 49151] NULL pointer dereference in pata_acpi X-Bugzilla-Reason: None X-Bugzilla-Type: newchanged X-Bugzilla-Watch-Reason: AssignedTo io_ide@kernel-bugs.osdl.org X-Bugzilla-Product: IO/Storage X-Bugzilla-Component: IDE X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bp@alien8.de X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: io_ide@kernel-bugs.osdl.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: In-Reply-To: References: Auto-Submitted: auto-generated MIME-Version: 1.0 Message-Id: <20121023101754.91A7111FB3D@bugzilla.kernel.org> Date: Tue, 23 Oct 2012 10:17:54 +0000 (UTC) X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org https://bugzilla.kernel.org/show_bug.cgi?id=49151 --- Comment #14 from Borislav Petkov 2012-10-23 10:17:54 --- On Tue, Oct 23, 2012 at 11:05:49AM +0100, Alan Cox wrote: > > So yes, blacklisting it and verifying that your system still operates > > normally would be something to do. If it does, you could also build a > > kernel with pata_acpi disabled (that is, provided you build your own > > kernels). > > The crash is still a bug. It needs chasing down. Yes, ata_timing_find_mode gives NULL, we found that out. Anton, Phillip, anyone willing to run this hunk below and get us the output: --- acpi->gtm.flags |= (1 << (2 * unit)); -- Thanks. diff --git a/drivers/ata/pata_acpi.c b/drivers/ata/pata_acpi.c index 09723b76beac..80d594d6e7c8 100644 --- a/drivers/ata/pata_acpi.c +++ b/drivers/ata/pata_acpi.c @@ -144,6 +144,13 @@ static void pacpi_set_dmamode(struct ata_port *ap, struct ata_device *adev) /* Now stuff the nS values into the structure */ t = ata_timing_find_mode(adev->dma_mode); + if (!t) { + pr_err("%s: ata_timing_find_mode gives NULL; adev->dma_mode: 0x%x\n", + __func__, adev->dma_mode); + + return; + } + if (adev->dma_mode >= XFER_UDMA_0) { acpi->gtm.drive[unit].dma = t->udma;