Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3574845imc; Wed, 13 Mar 2019 23:45:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMs2iJXkgCKWaKp6/R53nLhXQU3syvEOjMkGI+ihq6tbZW5G73k+OlK4cyLykzYz2Zor1k X-Received: by 2002:a62:788e:: with SMTP id t136mr632908pfc.249.1552545918504; Wed, 13 Mar 2019 23:45:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552545918; cv=none; d=google.com; s=arc-20160816; b=ozg3VduXUISEbZ0ZgAceqy7DaLJFv6HAbj8gLgX3Mk5341ILhJ7OPXyFOGC+/OX2IO TBJgGf+CvyytuDQFMNuVpljL3u3kRt1MfZcwsttjHyNHmKrglzbGUd5Q+K1FqTrwkLeH NFaPtW05dKmlrpvaeYF8ec1BdNqT6q3xPTOH+//z9jtCUzyEBrwjhyrQDmrTHNhIxaA/ I2S0Ety6vz0stPa7zBggGrfFp4Rt52mf+Vxdde2IFdn1iQwLj+Z0ER9hSPyf+sZYTsXa 9VIaBGX/9MsH6quPwbNXreVTxn/4ASnuYgi7OsBtH05N6/+fJMnEVMzFSQHJzgILhERk Mfdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=UaqXkDyxPeS1Bl07tP9L2bvvIcJ1LhWTA5MLjIao2h0=; b=0lPpP39YpxxHF4fzOLRB+3NlY5jQMRL8I662bM4Ohda/vDJqwvpp7c61lyA+uTXjm/ yKworTnj4UYHA3SrVelEs4FHqXIMrc9vsKRmfPJcwShrIb6jAOvE5Dp/4cMw5l1K0Ax4 NYl1ovODmhEAFqyEN8lifXRg7HmCvf+KTNTqZlP6MBdyPULoPrfFz/yIqM/dlcxvuynT IU8BbaA6f+wxH120DZY8vbjZztmrXOZQGDG15v0M7l3rFEIatfrCxDgdgFJbax/2lIaK tLAxTJKaVNhVcG8MzawYvJu+QB7GsESUBdeIGOdmlKR7fhSz3b1+GBSasgz2n/JYEMnl 1K1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@umn.edu header.s=google header.b=WW8oYVIF; 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 bg1si12838378plb.118.2019.03.13.23.45.04; Wed, 13 Mar 2019 23:45:18 -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=WW8oYVIF; 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 S1727363AbfCNGnx (ORCPT + 99 others); Thu, 14 Mar 2019 02:43:53 -0400 Received: from mta-p6.oit.umn.edu ([134.84.196.206]:47764 "EHLO mta-p6.oit.umn.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727356AbfCNGnu (ORCPT ); Thu, 14 Mar 2019 02:43:50 -0400 Received: from localhost (unknown [127.0.0.1]) by mta-p6.oit.umn.edu (Postfix) with ESMTP id A3C14C6D for ; Thu, 14 Mar 2019 06:37:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at umn.edu Received: from mta-p6.oit.umn.edu ([127.0.0.1]) by localhost (mta-p6.oit.umn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ooZkE993mkRV for ; Thu, 14 Mar 2019 01:37:56 -0500 (CDT) Received: from mail-it1-f197.google.com (mail-it1-f197.google.com [209.85.166.197]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mta-p6.oit.umn.edu (Postfix) with ESMTPS id 7048EC65 for ; Thu, 14 Mar 2019 01:37:56 -0500 (CDT) Received: by mail-it1-f197.google.com with SMTP id w200so3789402itc.8 for ; Wed, 13 Mar 2019 23:37:56 -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; bh=UaqXkDyxPeS1Bl07tP9L2bvvIcJ1LhWTA5MLjIao2h0=; b=WW8oYVIF1wqGwnPWBs6OmKB9BqhkBd/fI4GWNK6+D1eFse+nXF0Ez0HcmePE2pogMH iKdv/nptXc3w4GeJAKMdm2Sjld8SCzB3VsJg1u0Gf39HXSakvDlStXX5KZQNUbydVtyg jWnBrMhpl3x0IwgbM39Fhb1Yini6TgLkUD7WgANlg8bYjI1inomxnlwVnsDD8dqsTqWu BNYnGDPN1bkd+dHepPbNI8TnjCTQbW/DpniO25YJX2tOMHhN+o5D1M/WaeQS4OwNtFh/ tU/rUCoBYujTSqTA6RmueXLLxS/xPCy7igcnz5sN4aeF7Ko5ej7RAoNgcRdJPFG9eGSK knSw== 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; bh=UaqXkDyxPeS1Bl07tP9L2bvvIcJ1LhWTA5MLjIao2h0=; b=afGUyTGQO/i+DUctebF0E82lkZC+rCdmxznpYi6BoQ4wHmEKv9f3o6MDrqgmpNTQaL rIwpPPMjMwSR4kfwaf+GBiTB9OYWKESQ0tNnrUaOqDhRYf/ipz/fKxOCT4GKxHFScEp+ 06vGg4KxXx6uMfQpJC2cFcgABoeHXVLHJmYwEGfZL3xD8KHnAC4DbR3xJG1LcIuEH0U+ DsVj/IeuJS2cbgjouN8S4TIRm7m1okoDxj3MOCB1M2B3pOnefQdY6pQilFW1+P8NT1T1 qnXb1v6idH0AXcZa97Rg761Bv+fJ7DlINLIxGhXhJQ45WCn8hKWriK7fDYIT4wpAxcii qrAQ== X-Gm-Message-State: APjAAAX6Kq0SxztZlF+Wwec5j3RXaxxVSl3CeC8o4T1xkZBL1tKuAqtE 5NJayDgs3rtrx1gNQUdI7EFOiye0h0X+94Udk9lFU/prnerPUUwILzjmWviftwHggQcPXkYgOsS pwPYIEokcbq150aQLWZ1jAu01EfOH X-Received: by 2002:a24:f709:: with SMTP id x9mr1038285ith.149.1552545476052; Wed, 13 Mar 2019 23:37:56 -0700 (PDT) X-Received: by 2002:a24:f709:: with SMTP id x9mr1038276ith.149.1552545475800; Wed, 13 Mar 2019 23:37:55 -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 y18sm5836101ioa.56.2019.03.13.23.37.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 23:37:54 -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] scsi: ufs: fix a missing check of devm_reset_control_get Date: Thu, 14 Mar 2019 01:37:49 -0500 Message-Id: <20190314063749.13907-1-kjlu@umn.edu> X-Mailer: git-send-email 2.17.1 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 pass the error code upstream in case it fails. Signed-off-by: Kangjie Lu --- drivers/scsi/ufs/ufs-hisi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/scsi/ufs/ufs-hisi.c b/drivers/scsi/ufs/ufs-hisi.c index 452e19f8fb47..ce9d7c40909f 100644 --- a/drivers/scsi/ufs/ufs-hisi.c +++ b/drivers/scsi/ufs/ufs-hisi.c @@ -544,6 +544,11 @@ 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