Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3729624pxb; Mon, 24 Jan 2022 16:32:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJCirGLqeDN57WtDP5Jc16jIRClJ9rOO3s11oClV9XZVFIEP1NGRnNqRRxoU+jk2Nn025Z X-Received: by 2002:a17:90b:ed6:: with SMTP id gz22mr885363pjb.0.1643070742029; Mon, 24 Jan 2022 16:32:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643070742; cv=none; d=google.com; s=arc-20160816; b=nL9YEmqwwuseJE+Iv21Uoo5T4Hvm/qwwiLOzWWze/tuizxm4MZK2+4kXuJVuVygq1H sP931EO9YqlTxibr3xvNl4nEUpjD+EXlnsqdJI7BaTFUy1+XD7dYzwQpf6Q+o15ySjZN tkQR2DjvyW4PDNlIcernVD3sqja1UmwfHgrg3opuZ8y6aqjXbzLfrz0PRjmcxv9Nx/BM DnMYjdbM2H8M3Er/voWnmAV3WL32QOSQBQp4/Ldud4wlEOIgs8HGl/NxWxRpR0aBXx0x BgAlIzZhkCOeAIi10qPPSu+olFnkh9ITPlJScwBuuSeAu0SPQj6Q2MMFXIMKwScQCvUy xm4g== 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=0pCi+LQz/4iVvhWLzBOzmt2mqHwLBGQzDkZjicOKAkI=; b=WIDtE3b91Ea92/+/9SHDWA10XwWYQoDJmq/QVByep+uHn4VGdxwv9OlaKV2dbHyegb FicMCf7Ej45qM3evu0c6WgbRt3jQ06sOYmKRDVLVeUUYIqSSl0qb7FVG7AwtU7sxoQGW iR6ry8L4PMOPDxxTNNcgLlAnFFseyxYSZXf1G59Dtvm9AcKoyOLk/SnJHCHy+J5kbUVF UK/h6xZS/Y5ZLX3U/IsCpM3qcQe8ecMQ9x9tSEvon4Q3jibPmvnDpOzi3oPrFbdPLX59 TOXpW4huNrIUfOe07u9HsQeUNIGAZsdESNvZwEWEUxT+IIgGEftd6LUIQv3U20gL2lQq MBlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Zg7GN0UH; 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 d9si15191774pgb.583.2022.01.24.16.32.09; Mon, 24 Jan 2022 16:32:22 -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=Zg7GN0UH; 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 S3410698AbiAYA3r (ORCPT + 99 others); Mon, 24 Jan 2022 19:29:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2363495AbiAXXoo (ORCPT ); Mon, 24 Jan 2022 18:44:44 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17864C0FE687; Mon, 24 Jan 2022 13:39:23 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id D41FBB8121C; Mon, 24 Jan 2022 21:39:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3EBAC340E4; Mon, 24 Jan 2022 21:39:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060360; bh=cg2dTilaFyJIJO06u5dnZECifYEUV5gg6BwU7cPzgHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zg7GN0UHCrQlsEqRSOHlv4qjZHLxyi2ec757OTfymuRcm30t4efvYEkaFVfCVLJ36 LGAsjQU2NHvStXwQCUG8s+M41ptqtuiO6+PtQL1zT3zkduUhNDKzWDjpR8BEC4elwc c7MuUIHwPQdCioQZsy7eXcBzTwXaWk7ckuL/MSzg= 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.16 0922/1039] scsi: ufs: ufs-mediatek: Fix error checking in ufs_mtk_init_va09_pwr_ctrl() Date: Mon, 24 Jan 2022 19:45:11 +0100 Message-Id: <20220124184156.293502487@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 @@ -557,7 +557,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;