From patchwork Fri Mar 27 23:51:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 6113011 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 2C5F8BF4A6 for ; Fri, 27 Mar 2015 23:52:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4E259203ED for ; Fri, 27 Mar 2015 23:52:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 04922203EC for ; Fri, 27 Mar 2015 23:52:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752527AbbC0XwL (ORCPT ); Fri, 27 Mar 2015 19:52:11 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:35952 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752316AbbC0XwJ (ORCPT ); Fri, 27 Mar 2015 19:52:09 -0400 Received: by padcy3 with SMTP id cy3so109317614pad.3 for ; Fri, 27 Mar 2015 16:52:09 -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=Jfte1fTjO1E/wnrfLSSHEh4FysX9cjC0dkbcQ3R8Fvk=; b=QPH7NVUxRedxW9hTX89OqrwF4ET0eKy9f0VRVUqjLSSwlbt2GBsNhlNM+KXe5a3OX5 Xcrj2XchVbxjqijAhFy1gffqGcZdN5HvZwPrpySsplFdxfzusUvlMLRIa4bSx1V4Q97n /gHoZfQXdt+OGVRMK9UqTRmtCeFEwgPv1RID5yUEao846hxq9cfA3/ojnmLeuAM0b+Cs 2vJ+jc4HZPHjhcxVNXGqOktlU6spbq/iK7nwhzsT8FyGhA0xVup0bWXsRte6F+xh9IEW RwPyr+H+qYEeUsRbtLbFDh0KAeqbRNHfsuhmZ1RA+DaThQinazRxt1AOeyFsui5gCyPm f1yQ== X-Received: by 10.68.226.35 with SMTP id rp3mr39899953pbc.54.1427500327163; Fri, 27 Mar 2015 16:52:07 -0700 (PDT) Received: from localhost.localdomain (KD106168100169.ppp-bb.dion.ne.jp. [106.168.100.169]) by mx.google.com with ESMTPSA id d4sm3252532pdm.50.2015.03.27.16.52.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Mar 2015 16:52:06 -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 1/3] scsi: ufs: avoid using hostdata after scsi_host_put() Date: Sat, 28 Mar 2015 08:51:45 +0900 Message-Id: <1427500307-5649-2-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427500307-5649-1-git-send-email-akinobu.mita@gmail.com> References: <1427500307-5649-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=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_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 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 5d60a86..4e4de32 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -5239,12 +5239,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); @@ -5547,9 +5547,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);