Received: by 2002:ac0:a874:0:0:0:0:0 with SMTP id c49csp194642ima; Fri, 15 Mar 2019 00:13:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCa+PDraS18Ex/HC2x1wUtijF7ugCXs3YYelQsUuKnHVeNuBikSplOEozp51V7oBnoHIHY X-Received: by 2002:a63:c511:: with SMTP id f17mr1975678pgd.202.1552633988132; Fri, 15 Mar 2019 00:13:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552633988; cv=none; d=google.com; s=arc-20160816; b=CeJF9L/9dsyw7IiHv4ra365J2+p67YbYnHhKFUW7IV4JFuZUGeVWXTk9/rxapXVpMX PjfRyHEzE6lVGRaB+hImcIWdxEemFgse/tNV+T4B3XYsBJAKjVKjfrShY+APmw25n0I0 TJGBNZbuoeQ9GiKdfLC84kAI/QW4vbG+d1ENbn0OFdV/rW+oBoYxNFHSlWuNVwOqepcM EEu0NxlzKykxd/zmmOPqvXR/ZqXUXPzvfHS7gTdoW0eheWDbdBu0OzS7GVUecVXKCoM7 zS2ROeuN/FZWPIUthCIcH8saaBeRSCXOKI3+IFvz8hSCqiA5S/pDLCqqF4S3lSOIat8p oRPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=17W7n2bCWmlwTSpVZcXn97DFxdwzQ+dBaO0OQ4OoLWo=; b=gf62S4INEtJ4Elv/Z8z1y/2gq6T+W8HVPENtkK0vE+0OoUZEySv+TKDwP6oHQasZjP NeF89cCQjcyHsgAygs04tIcTWiKwkUI9fPNsnRL0xpzD+KjK1YPUtAl0xjyRFWjafF2N hR4SpZdx1h3nZ5bb8BXAqLKq5oVzCzuZdWP1axIhSBQbUYGUhwrGR+fY+LY+cpDjBX+t S0njMk8YymTIBiyCxDTISyi5oln4oZbQ6IfQa4cKVkF2UqD2Kg5TFPt/zN8l7AcNoWfP TMF2623M4Zk8G2gDrdd9yOrd55dFKWbiUKkpFgsl/KQ6jNGzZwTKFRsCu5XuPEBVe7Kc JN1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@umn.edu header.s=google header.b="E7R6v/U+"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umn.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 193si1183763pga.251.2019.03.15.00.12.52; Fri, 15 Mar 2019 00:13:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@umn.edu header.s=google header.b="E7R6v/U+"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umn.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728435AbfCOHMK (ORCPT + 99 others); Fri, 15 Mar 2019 03:12:10 -0400 Received: from mta-p5.oit.umn.edu ([134.84.196.205]:56568 "EHLO mta-p5.oit.umn.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728364AbfCOHMK (ORCPT ); Fri, 15 Mar 2019 03:12:10 -0400 Received: from localhost (unknown [127.0.0.1]) by mta-p5.oit.umn.edu (Postfix) with ESMTP id 0B405645 for ; Fri, 15 Mar 2019 07:12:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at umn.edu Received: from mta-p5.oit.umn.edu ([127.0.0.1]) by localhost (mta-p5.oit.umn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gcA48KzyKufI for ; Fri, 15 Mar 2019 02:12:08 -0500 (CDT) Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mta-p5.oit.umn.edu (Postfix) with ESMTPS id B7424629 for ; Fri, 15 Mar 2019 02:12:08 -0500 (CDT) Received: by mail-io1-f71.google.com with SMTP id a7so3462367ioq.3 for ; Fri, 15 Mar 2019 00:12:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umn.edu; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=17W7n2bCWmlwTSpVZcXn97DFxdwzQ+dBaO0OQ4OoLWo=; b=E7R6v/U+sRV30CPT76jhsao26xQ8hZDsYbdDj+DeApIKnr5IWe54vSckXbfsljhzHD MKci0iIR78FK9+mYkyWzLX///BXTDatoZwcHXhwjH3CyRkicoBNEhWjbWbyOComuS6si AkV7m/E99kBWvltkh4t1oFKEjkrkJtXGKV3HavDLWQLMB6YgdT/OWnG3Uz/+aMz569C6 1FeJd2PTlRPQV29YqOFh7wqlFFntCzeZtwUjL1aNT00ZPhma0VqQiSDeA39O+zkqmAAq 9Zc4VRtoMYGG6wikOXhXBZFOb+Cj4hIfGnzAiuP4Kqg58hDUZv+GzRLP3AE2qp+8AAYC jfsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=17W7n2bCWmlwTSpVZcXn97DFxdwzQ+dBaO0OQ4OoLWo=; b=Iq9IATLKWwuWnQl2ND3SevkQpeL/K6i5rDF//+Bfxdzd8kQ4vRW8zuFsU1e2E7UVLh hn3tHjYTAPrYBh4cL85mLIkb03gs80zh4/X1MIYsl9ouqJTLYe+FNmCCVkbhUP/hVx8E 5x9asSYKIO3S/5Dx60bWvRsJOSjGuhr4LOnQlcelC+8E7hjMD/8gtTN/PT1e0qRVPEic Quq894xtDLFmD14hOo8mUnWewQgow8uCrxUskqsenAgN8yTJVF+2jRFuqH0sY230vtve Q3QEzCwpMnuUZR16bE98iPMKoF4eEPgZxkOC4dtat8GeKV8pYy2rVQATcCE3y7O70vsX d24g== X-Gm-Message-State: APjAAAVL/SewYv7vOXQfOitzSd1b5q7dG0PnUZ2lBK47yLk0K046FOo5 1+XccpWAbcQf+a5p+Pb9KnhxGDC2En0wpyvqDk1DvB3fqKICMR31ic8I6OB6Hps3zblHWeUUgm0 GDsFQzQwNORl2wDBGIwJZb/W4GsZ4 X-Received: by 2002:a24:d4c1:: with SMTP id x184mr1021568itg.174.1552633927415; Fri, 15 Mar 2019 00:12:07 -0700 (PDT) X-Received: by 2002:a24:d4c1:: with SMTP id x184mr1021557itg.174.1552633927201; Fri, 15 Mar 2019 00:12:07 -0700 (PDT) Received: from bee.dtc.umn.edu (cs-bee-u.cs.umn.edu. [128.101.106.63]) by smtp.gmail.com with ESMTPSA id e73sm645199itc.39.2019.03.15.00.12.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Mar 2019 00:12:06 -0700 (PDT) From: Kangjie Lu To: kjlu@umn.edu Cc: pakki001@umn.edu, Vinayak Holikatti , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] scsi: ufs: fix a missing check of devm_reset_control_get Date: Fri, 15 Mar 2019 02:11:56 -0500 Message-Id: <20190315071156.21588-1-kjlu@umn.edu> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org devm_reset_control_get could fail, so the fix checks its return value and passes the error code upstream in case it fails. Signed-off-by: Kangjie Lu Acked-by: Avri Altman --- V2: Use full line please --- drivers/scsi/ufs/ufs-hisi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/ufs/ufs-hisi.c b/drivers/scsi/ufs/ufs-hisi.c index 452e19f8fb47..c2cee73a8560 100644 --- a/drivers/scsi/ufs/ufs-hisi.c +++ b/drivers/scsi/ufs/ufs-hisi.c @@ -544,6 +544,10 @@ static int ufs_hisi_init_common(struct ufs_hba *hba) ufshcd_set_variant(hba, host); host->rst = devm_reset_control_get(dev, "rst"); + if (IS_ERR(host->rst)) { + dev_err(dev, "%s: failed to get reset control\n", __func__); + return PTR_ERR(host->rst); + } ufs_hisi_set_pm_lvl(hba); -- 2.17.1