From patchwork Sat Aug 1 17:19:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 6922481 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6312FC05AC for ; Sat, 1 Aug 2015 17:19:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4932720501 for ; Sat, 1 Aug 2015 17:19:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 22107202B8 for ; Sat, 1 Aug 2015 17:19:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751373AbbHARTn (ORCPT ); Sat, 1 Aug 2015 13:19:43 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:33024 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751015AbbHARTm (ORCPT ); Sat, 1 Aug 2015 13:19:42 -0400 Received: by padck2 with SMTP id ck2so59211755pad.0 for ; Sat, 01 Aug 2015 10:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LLvFIruVemutbvjCgzCupidV9lXlL7SeA9DP8e8KDl4=; b=uSXMBHZ4Jt5zUbuTWkW3dEz5x9IC7xTGmuZjwTpeFbY7X7xRvt1D1fAe7b1TiYDaWu OA4idAAPvG5m9UG0fVYmLQousKZQo9E7cF8YZl/4E8JaypTAah4kOaM/0zbSZOfhxayE X//HxVBEttmoeu9olc5PzLrjxwK/dK8n78y0EX/SPl0wweufA9H0Zmus5GJ52w2AOokk 1DL+gbj2QeE3EsWSZH+TOvrmvTEUv9LV6d/tI+aLZ9nhC50km/rSfa/RIpe633DYkJe4 GjLiveYniqGzT4OhyFDDG5dyvl6euKtmIEeulqJYfHpSLikx4rehpsZH+MscnlZgaof+ 2HFQ== X-Received: by 10.68.169.69 with SMTP id ac5mr7674070pbc.14.1438449582370; Sat, 01 Aug 2015 10:19:42 -0700 (PDT) Received: from localhost.localdomain (KD113159139091.ppp-bb.dion.ne.jp. [113.159.139.91]) by smtp.gmail.com with ESMTPSA id tm3sm12259153pac.44.2015.08.01.10.19.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 01 Aug 2015 10:19:41 -0700 (PDT) From: Akinobu Mita To: linux-scsi@vger.kernel.org Cc: Akinobu Mita , Vinayak Holikatti , "James E.J. Bottomley" , Christoph Hellwig , Dolev Raviv , Sujit Reddy Thumma , Subhash Jadavani , Hannes Reinecke , Sahitya Tummala Subject: [PATCH v2 1/6] scsi: ufs: avoid using hostdata after scsi_host_put() Date: Sun, 2 Aug 2015 02:19:15 +0900 Message-Id: <1438449560-4106-2-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438449560-4106-1-git-send-email-akinobu.mita@gmail.com> References: <1438449560-4106-1-git-send-email-akinobu.mita@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 The hostdata array, which is denoted by 'hba' in ufs driver, should not be accessed after calling scsi_host_put(). Signed-off-by: Akinobu Mita Cc: Vinayak Holikatti Cc: "James E.J. Bottomley" Cc: Christoph Hellwig Cc: Dolev Raviv Cc: Sujit Reddy Thumma Cc: Subhash Jadavani Cc: Hannes Reinecke Cc: Sahitya Tummala Cc: linux-scsi@vger.kernel.org --- drivers/scsi/ufs/ufshcd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index b0ade73..e25f919 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -5363,12 +5363,12 @@ void ufshcd_remove(struct ufs_hba *hba) ufshcd_disable_intr(hba, hba->intr_mask); ufshcd_hba_stop(hba); - scsi_host_put(hba->host); - ufshcd_exit_clk_gating(hba); if (ufshcd_is_clkscaling_enabled(hba)) devfreq_remove_device(hba->devfreq); ufshcd_hba_exit(hba); + + scsi_host_put(hba->host); } EXPORT_SYMBOL_GPL(ufshcd_remove); @@ -5671,9 +5671,9 @@ exit_gating: ufshcd_exit_clk_gating(hba); out_disable: hba->is_irq_enabled = false; - scsi_host_put(host); ufshcd_hba_exit(hba); out_error: + scsi_host_put(host); return err; } EXPORT_SYMBOL_GPL(ufshcd_init);