From patchwork Thu Apr 10 22:17:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Cameron X-Patchwork-Id: 3965081 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 22F119F3D5 for ; Thu, 10 Apr 2014 22:18:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5440D20807 for ; Thu, 10 Apr 2014 22:18:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 824AC207FB for ; Thu, 10 Apr 2014 22:18:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754220AbaDJWSD (ORCPT ); Thu, 10 Apr 2014 18:18:03 -0400 Received: from g6t1526.atlanta.hp.com ([15.193.200.69]:59208 "EHLO g6t1526.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753800AbaDJWSB (ORCPT ); Thu, 10 Apr 2014 18:18:01 -0400 X-Greylist: delayed 3382 seconds by postgrey-1.27 at vger.kernel.org; Thu, 10 Apr 2014 18:18:01 EDT Received: from g5t1633.atlanta.hp.com (g5t1633.atlanta.hp.com [16.201.144.132]) by g6t1526.atlanta.hp.com (Postfix) with ESMTP id 58B6B1D5; Thu, 10 Apr 2014 22:17:57 +0000 (UTC) Received: from beardog.cce.hp.com (beardog.cce.hp.com [16.84.84.24]) by g5t1633.atlanta.hp.com (Postfix) with ESMTP id A222869; Thu, 10 Apr 2014 22:17:56 +0000 (UTC) Received: from beardog.cce.hp.com (beardog.cce.hp.com [127.0.0.1]) by beardog.cce.hp.com (8.13.8/8.13.8) with ESMTP id s3AMH5VW022488; Thu, 10 Apr 2014 17:17:05 -0500 Received: (from scameron@localhost) by beardog.cce.hp.com (8.13.8/8.13.8/Submit) id s3AMH4kF022487; Thu, 10 Apr 2014 17:17:04 -0500 Date: Thu, 10 Apr 2014 17:17:04 -0500 From: scameron@beardog.cce.hp.com To: James Bottomley Cc: Bjorn Helgaas , Davidlohr Bueso , Baoquan He , "linux-kernel@vger.kernel.org" , linux-scsi , "linux-pci@vger.kernel.org" , Joerg Roedel , "open list:INTEL IOMMU (VT-d)" , Jiang Liu , scameron@beardog.cce.hp.com Subject: [PATCH] hpsa: fix uninitialized trans_support in hpsa_put_ctlr_into_performant_mode() Message-ID: <20140410221704.GA22465@beardog.cce.hp.com> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Without this, you'll see a null pointer dereference in hpsa_enter_performant_mode(). Signed-off-by: Stephen M. Cameron Tested-by: Baoquan He --- drivers/scsi/hpsa.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 8cf4a0c..ef4dfdd 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -7463,6 +7463,10 @@ static void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h) if (hpsa_simple_mode) return; + trans_support = readl(&(h->cfgtable->TransportSupport)); + if (!(trans_support & PERFORMANT_MODE)) + return; + /* Check for I/O accelerator mode support */ if (trans_support & CFGTBL_Trans_io_accel1) { transMethod |= CFGTBL_Trans_io_accel1 |