Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3617725pxb; Mon, 24 Jan 2022 13:37:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwX58DWiStwaWFlSnzJRWzE+8IciXyV6JdSduyL8qrXXmrGo+mLRf2dihK7LqWqN7Lxrteg X-Received: by 2002:a17:90a:199b:: with SMTP id 27mr286462pji.158.1643060261435; Mon, 24 Jan 2022 13:37:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643060261; cv=none; d=google.com; s=arc-20160816; b=ieW/OvippuZC+BH+1/UODduuMwJ2iVZYCHPRbWrBrQpLzrGZjuu3aGToVLCRKpN99m QW0r8dS/4B186d/mYjc1beMFEtUH0gf8A5yYARzoxRzxiE9Ri6N/AuTtYpaZ2Dej4XlX mRcXEbIYWVwM5YgzTT4cvDMqoWJjBEcspi66M9ZzOSo1LvMkD7tWxvAz5Ks783M2iPBD SdoUjLchoLJOLRJHP/VJiL3B7Bqvifr3mbczGqHYV/1XcKNO57Fr0uwkfb8Fqk9oDoLl JGCH0D1R4Ncb2pfQmxv/1RXFqccELO4ktCj17C4NwTq3/pWzRVyx0Q1rSToZ0pH/zod1 0OCQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6LjZ4fElpk4p7jVY9/0XGCRSP4GE85Y3d64mPWTYlOc=; b=bdzk+noslZhox6sJOdLJCXDz2nDP+AMbj4IsZWgHr5hJIxhBLUAWGBwV1cd8hqcPtk uXYvVDTKkLaqZx3nNIjPnJSSqSnWBiWpxvaMI71Jrkr1OUnPrGJberFeGYmXBpEoK+3Z RWeiuLWkH6QXQLlWY/4txuD9lnoGQR8xOxDNxRh7wkJaJSmHcXCFMgaEJ7P+MP2qOrhi hr8i2AyTDYrwnF5Ow5bLvPfiU6iyO7tftxr2v8hscBh0InQMHNXKklsO943NBlzp1eIE w8OsMDjEcZY1K7ZrgWszYh/i/UHndDR2qp3R2mZ/AtZ3HtksPM7nVTBHseMs3MzhA/3f l5eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=phBst9ky; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si14811948pgp.453.2022.01.24.13.37.29; Mon, 24 Jan 2022 13:37:41 -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=@linuxfoundation.org header.s=korg header.b=phBst9ky; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1449042AbiAXVOj (ORCPT + 99 others); Mon, 24 Jan 2022 16:14:39 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:41732 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1391328AbiAXUrZ (ORCPT ); Mon, 24 Jan 2022 15:47:25 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A1FD260B18; Mon, 24 Jan 2022 20:47:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 722DBC340E5; Mon, 24 Jan 2022 20:47:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057244; bh=mGfUd3HAafgw69SmJ/VHmCTthCgBZVr9YmGbS1ZMPp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=phBst9kyycBfjG9EjAevd7vnTwA+FUR9FfHkOsJztGTGc+W9GwKmgnR7EQz2xdNvv 3UrLMhlNKKz2rdnvvDJQ33aSlFd704/2HxMmQgwJSwXGsxNK1Uq1Or76Tw7I59uT6P 7B2NT/bZjAPSaILdk1XR2SRtDfKgQr6HRMhCn3Oo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , "Martin K. Petersen" Subject: [PATCH 5.15 747/846] scsi: ufs: ufs-mediatek: Fix error checking in ufs_mtk_init_va09_pwr_ctrl() Date: Mon, 24 Jan 2022 19:44:24 +0100 Message-Id: <20220124184126.749169560@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaoqian Lin commit 3ba880a12df5aa4488c18281701b5b1bc3d4531a upstream. The function regulator_get() returns an error pointer. Use IS_ERR() to validate the return value. Link: https://lore.kernel.org/r/20211222070930.9449-1-linmq006@gmail.com Fixes: cf137b3ea49a ("scsi: ufs-mediatek: Support VA09 regulator operations") Signed-off-by: Miaoqian Lin Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/ufs/ufs-mediatek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/scsi/ufs/ufs-mediatek.c +++ b/drivers/scsi/ufs/ufs-mediatek.c @@ -501,7 +501,7 @@ static void ufs_mtk_init_va09_pwr_ctrl(s struct ufs_mtk_host *host = ufshcd_get_variant(hba); host->reg_va09 = regulator_get(hba->dev, "va09"); - if (!host->reg_va09) + if (IS_ERR(host->reg_va09)) dev_info(hba->dev, "failed to get va09"); else host->caps |= UFS_MTK_CAP_VA09_PWR_CTRL;