Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2637842pxu; Mon, 14 Dec 2020 07:25:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzu3lHo51r9WHrMzmGLc+649vLkBAWTG5Fewd2D/Cfx9g44aQBrmVRSYlcXIk0oEFlr05MJ X-Received: by 2002:a17:906:ae14:: with SMTP id le20mr23516578ejb.451.1607959550072; Mon, 14 Dec 2020 07:25:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607959550; cv=none; d=google.com; s=arc-20160816; b=Yypq3TavcoyBGu3VnG4fO8xfIvjJTwaSIu3UBXBmy1XCmtIl6jAT8WDuMbx+v5s5aj TrlPKy0z+NkId6tH0SCJAcb7HUGi5UTRBS/UqNnqgK4tKYzOE2cHb2VsONxJu30jOImg i2IQRqc+GEDuEyMfmpL4yuwia2J/Ksuonu1ySqyNeG/rVF3C5MdPHTrVbGlu/u/EY8XD DF7IUHML8vLVs8fBc6JerMNa8bUBXPbZjgEApjSJGpyIkWHAZBxG75Z5lxU0Uzk9TT5r 9lHO8xkIMpKgzIjpd6R/xlsqQPWeB8QU+dFziAB2Js9+ezbYXPs3vxchf4f/JoTEl7HK tYjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=JtZlG2TMyR1uzxpDuh0ZpCaVmKX8ab8m6m4yiucXZd8=; b=HHRDK5oML3HTjNENuuZjzY6NPDXcHUOL2WF7IaxpWJuKmoA93FaLKqXPiTm1DMC7Hv FbvF7qV0GfXM99ssinrIGM43Hb6GQUvM1FOi9ZCNpWe9Vr0Fn983gJSmCcQtSd4pRWq1 n0nSgZ9KJ/T0BctW70kOPEAUte0baO6xUQwiCMuUeY5u0Ad4hWbc8IkWDBSji+6vt0YN HvOCzzxczjFMNWaudrBA1Oh5MvAm3MFJV6MHl0c+vbI97iwvwzFpBQMDCJbzpQUx7hgu 6BwJn/jBSqWSgjvrDeo5Vi2UBmo2J9ZDDNPakBMdH29BqR0PYdlSwU0KDNuvroBhmcbw PFog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Jv71QX4c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t21si10438124edi.2.2020.12.14.07.25.25; Mon, 14 Dec 2020 07:25:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Jv71QX4c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437761AbgLNOdJ (ORCPT + 99 others); Mon, 14 Dec 2020 09:33:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727309AbgLNOdI (ORCPT ); Mon, 14 Dec 2020 09:33:08 -0500 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55725C0613CF; Mon, 14 Dec 2020 06:32:28 -0800 (PST) Received: by mail-ej1-x641.google.com with SMTP id d17so22777219ejy.9; Mon, 14 Dec 2020 06:32:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=JtZlG2TMyR1uzxpDuh0ZpCaVmKX8ab8m6m4yiucXZd8=; b=Jv71QX4cZGzIhCF0Z390WTp5fvzAKvcbvCTOr+y2l3q2sULpQ9ec5xz1oSlBR0sTkx LX8U0KHNsDRNOmsWhKuYrsBp6OSq4WqTJlyEOCp63pLh9sC2fwc9xqS7o/I2BEclYGmD rDcaR0XOrDfk1GvlbjnKJSKXLLn7qVmcXNxoED3BRHXMynUvQW7LyVKJXP1xsXt8KHRr i3IOU6liXq7JLibfyPZ69FFgKdC3hnsIKTC53J74Zgdzq4V2K09XqjaSydY/Su8Y5RLQ uyEYy5WyzrM71wtpTGJXVNpFAAk1aLc/C0IYkkRmV8GsKgfgKuMyVbH/emjXzqjJyQ/C oiYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=JtZlG2TMyR1uzxpDuh0ZpCaVmKX8ab8m6m4yiucXZd8=; b=Oh50dsZd2PL8gcflbelHdbA1HlXoqakVec/XUfiptM1+wTSOqJ/kyaHROXfzAPKsDD AH7Ss41ueUT9rx+QI9gmi+TZw6fzTf/6Pvu3+dYkD6QFEZREZyxC2Po6oajb05XZLxay gW8GMrhWmXbtMETNdQ58QFHr9SzOMI7xX9Kv0jVnCaV2zqxFUSEh85/AKPvoLQpcoQ/2 HGo1dVpKAQeByKnmUJ7+RfzKJrXJoDVP1nJGEioRDO1RW3KhsL0HYYQ9RZJlW12f9MMz 3WV78F5N0OAF78rA9PoKVfe0s4/Ohzi/+V52G57+L3h+WJn1HMK24I4DUvzEC6cklnKl W+Dg== X-Gm-Message-State: AOAM530L8KkeIrvbCyEXMgahNkwOL7Qn/xqvoEfON2MGsK0PG2xs2zsh e1cnbCUkETE+1Ulhpc4zl4A= X-Received: by 2002:a17:906:dc1:: with SMTP id p1mr23191835eji.9.1607956347034; Mon, 14 Dec 2020 06:32:27 -0800 (PST) Received: from ubuntu-laptop (ip5f5bfce9.dynamic.kabel-deutschland.de. [95.91.252.233]) by smtp.googlemail.com with ESMTPSA id h15sm14623665ejq.29.2020.12.14.06.32.25 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Dec 2020 06:32:26 -0800 (PST) Message-ID: <7eb8f335f4eb85385f54c88952f7749750340320.camel@gmail.com> Subject: Re: [PATCH V2 1/1] scsi: ufs: Fix a possible NULL pointer issue From: Bean Huo To: Can Guo , asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, rnayak@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, saravanak@google.com, salyzyn@google.com Cc: Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Stanley Chu , Bean Huo , Bart Van Assche , open list Date: Mon, 14 Dec 2020 15:32:25 +0100 In-Reply-To: <1607917296-11735-1-git-send-email-cang@codeaurora.org> References: <1607917296-11735-1-git-send-email-cang@codeaurora.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2020-12-13 at 19:41 -0800, Can Guo wrote: > Fixes: 88a92d6ae4fe ("scsi: ufs: Serialize eh_work with system PM > events and async scan") > > Signed-off-by: Can Guo > --- > drivers/scsi/ufs/ufshcd.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > index c1c401b..ef155a9 100644 > --- a/drivers/scsi/ufs/ufshcd.c > +++ b/drivers/scsi/ufs/ufshcd.c > @@ -8883,8 +8883,11 @@ int ufshcd_system_suspend(struct ufs_hba *hba) > int ret = 0; > ktime_t start = ktime_get(); > > + if (!hba) > + return 0; > + > down(&hba->eh_sem); > - if (!hba || !hba->is_powered) > + if (!hba->is_powered) > return 0; Can, why not moving down(&hba->eh_sem) after "return 0;"?