Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1891771pxb; Fri, 5 Mar 2021 02:10:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxBq6SzYpusljwa5B0jEaogkjJv8QsxcJG/sgj9tMhp/+nwxbPJqcmYk4h23FFDxMtPmU3k X-Received: by 2002:a05:6402:1d19:: with SMTP id dg25mr8463678edb.218.1614939005895; Fri, 05 Mar 2021 02:10:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614939005; cv=none; d=google.com; s=arc-20160816; b=GD/bpEPf2OPuPajcrG4SLZZrSLaemtApsQR+j4g8fL6SX/Tmlbnn/nbKXMaYHm5XzZ YwGqZmQGf+Pxzh3z2mYE6y6MK5d2EpH/iMW3U5lBJjXz2o1t11Z7mc2vi5gXcYOaBFmJ DOaulR/Wh/uM9ALHOU4k5h6HRWBdytyNkDvxJJCNcdNe/6wnapbV31Zygom6Dpf5x3Lj xyt+iQeRNTICK0HcUMHW0XMDXrNIcmg8+0yBgeRnX44Mqo77mNqoKDGYmBgatdxLK56Z Qe44dSaEiDUxUBX6dJOF7d1ExhYvXfVnaS7qVBoVl3uh1qLNjDgv3ijJNvmu0C+yLHYw DAjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=FaAijpHPImNv0WD5I90hcG5zei5rslAfFjyFTmWsex0=; b=NqCVf5UWDNMtVF6Dl5BRoHqez/fKEymvtOjw5vQ7LCfA6ev42ZGfUtHleOLuZnaGYd /QhldXLYziS7cKzFO0nOAIhUU9MduqdOa888IJ8OB0Ikt0/V9Ht7GzoA51AeaxSYmuCb XtB1Wu1OVMBefNQEimlEVDQZC8/zE626vXroGprXrGP7kkCnOyi+CrcgBwp+/DQ85ypo D+/P+PIMMSoajmVnZ02SCKXPvMtePKdmiynTWdlVMFFoMZqQGx6vgDHArsIkI0vo9Lii s20U0MxoXYlB3V2ctsO19Go4ZwuN8KbrGMoimIShwBNLzkUbWa92HOXrx62Vnki5L91+ 2D3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VBmc0tfA; 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 w25si1075230eja.753.2021.03.05.02.09.42; Fri, 05 Mar 2021 02:10:05 -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=VBmc0tfA; 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 S229815AbhCEKIo (ORCPT + 99 others); Fri, 5 Mar 2021 05:08:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229558AbhCEKIT (ORCPT ); Fri, 5 Mar 2021 05:08:19 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAC43C061574; Fri, 5 Mar 2021 02:08:19 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id n10so1031313pgl.10; Fri, 05 Mar 2021 02:08:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=FaAijpHPImNv0WD5I90hcG5zei5rslAfFjyFTmWsex0=; b=VBmc0tfANQgzpVv05QM+6UYYd8SeCk5aJBZ4A/6123VzWZX0ul2hiNd8E4/wvYUI3u 0WuD+IxtkcDBySqwPg6BXL1jZC0nOpvrsrOwM2Qr7LZQmy1ky0LQrz00R7hL8zE2CR3A PqWifwgEnIrxE+CS8v2n3hsziRd1rxL9Aiwll4PcxOEts76DJTDy9uZB86A8qV/BFi7q TPy1UuY1ElxOh3YJBwlKagKVwVJAPWBSzvmMlzYorqieAHgfOh51qoCVAWhLybDDNaWO AqzqM1JfmZuC/XTNCsmupetGaX+hvAirKsbVrHSjjOZQ8SxdGiXs0TrOpSN7UAbVPtB0 d9gQ== 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=FaAijpHPImNv0WD5I90hcG5zei5rslAfFjyFTmWsex0=; b=Ko7027NjlbHzNEW0rhdkKWJxLYKT3e+v9+GaoHqtPb8o3Wv+fV5Ktp/4h1V5BKeN2X yBcjjgZV3bJBBDzP59FYQsDNAIufHOnqSXJ8Go2SZNLS8nLwfCiNqlxBOKl2l/7XPs+2 cW84Zag5KGOxQEQHBmjXXjRSII68dkmCFwIl8jppB+fyu9U+Gf54zPOV+ZcFa4h9T5Xm FO07yx+ue4TQtrtdHBt3dMnutUCW48abtqae2RB/NoFww0JvjPlRFZFY4A/kj15wa6vA ja/Vr5NY9usIpIetfrntgVeM4ud1F/hZw4Yh5kq7yvVU+y/NnMwMXFZhnP3TVkeLg+Xe FgCw== X-Gm-Message-State: AOAM532EKefZJf0W/vkVgDO+NOC29pTzp2+I4bBJWw03sSBQJ58HfCKq WqJtsmnBuPtmyxVs1aPVbx0= X-Received: by 2002:a63:170e:: with SMTP id x14mr7847290pgl.245.1614938899393; Fri, 05 Mar 2021 02:08:19 -0800 (PST) Received: from localhost.localdomain ([45.135.186.129]) by smtp.gmail.com with ESMTPSA id t17sm2134571pgk.25.2021.03.05.02.08.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 02:08:18 -0800 (PST) From: Jia-Ju Bai To: alim.akhtar@samsung.com, avri.altman@wdc.com, jejb@linux.ibm.com, martin.petersen@oracle.com, krzk@kernel.org, kwmad.kim@samsung.com, beanhuo@micron.com, weiyongjun1@huawei.com, stanley.chu@mediatek.com Cc: linux-scsi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] scsi: ufs: fix error return code of exynos_ufs_get_clk_info() Date: Fri, 5 Mar 2021 02:07:59 -0800 Message-Id: <20210305100759.14500-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the list of head is empty, no error return code of exynos_ufs_get_clk_info() is assigned. To fix this bug, ret is assigned with -ENOENT as error return code. Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai --- drivers/scsi/ufs/ufs-exynos.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index 267943a13a94..d67652e5cc34 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -264,8 +264,10 @@ static int exynos_ufs_get_clk_info(struct exynos_ufs *ufs) u8 div = 0; int ret = 0; - if (list_empty(head)) + if (list_empty(head)) { + ret = -ENOENT; goto out; + } list_for_each_entry(clki, head, list) { if (!IS_ERR(clki->clk)) { -- 2.17.1