Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3610362pxb; Mon, 24 Jan 2022 13:28:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtkj15RTpP8RNqv1rznkiVphqbYPh1hQ+I+i1/shK0GInCoAnJI5jLRyfq1UIipgGxlPZx X-Received: by 2002:a17:902:da81:b0:14b:6182:6195 with SMTP id j1-20020a170902da8100b0014b61826195mr3398378plx.24.1643059716607; Mon, 24 Jan 2022 13:28:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643059716; cv=none; d=google.com; s=arc-20160816; b=eANHMiXd1Ylv739eSFbxd34TWi5dv+lOl64I9x4wgcAEtixwh3osBF2k08yavrrkV2 VsZErYWW+0a6DofKpPoHi8kUvIP49/n1TsVfOOaDkWoAls5yBYVWl2y1rPZLcUr+yaPf sE4+MOr466OendSnHlKpMQ8A7qrOCLykzSvPOW/GaCD6eabqymRLcdJAEdA7NIwSMNp+ DevOQcvwsM3KhrtUpqXxoStOtSxWZDLNh0wL+ohQdoUG+GYw7sJ6snDFTNDe8Q+KZt+e MW9UKvvIz4qf4ayeW03y/ygMnUDxkTbKa3KL1c8K8WkW8/5S6Sz4a+8BwaHnvyVsoQlO 7CfQ== 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=apFolW8cqBpvUf7Az/1zCQ+fyYitklUP4Oxv/yBewSk=; b=B4b3whkmKtvCT0l3gw/SykVoOYRUHfd7sV+ml6fdbUiNLMv5gZtSE7tiapK+IYTlg/ jgCaaDXC9Hly4/9eSxiEs4CU9RevC6fkm7xWaiXNYy7HTt3ka1FgSW9DhiW1lzKtceNl fmB1FYnK7TMpU0LKpNdN7j41L9NTx/6K4nfkohxs4vYBRKX7/t4EWDR02PNROmpicle4 eBPWu5Bp53nTsmp/homrTW31+kSIan4ZMgA1fKAF1NFPIkHh8goeG4TALQSEn7IJeH7B UsmYTIKx0yBegTLxzUXlcR7qYX3Ez0UadDCoaNqcGVlI4Sx+dpBoAhHfuivieM/tmVQy KGCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KjwnAWiN; 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 u7si18217663plh.276.2022.01.24.13.28.24; Mon, 24 Jan 2022 13:28:36 -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=KjwnAWiN; 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 S1376469AbiAXVFT (ORCPT + 99 others); Mon, 24 Jan 2022 16:05:19 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:38466 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344586AbiAXUm7 (ORCPT ); Mon, 24 Jan 2022 15:42:59 -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 AF4D46090B; Mon, 24 Jan 2022 20:42:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94926C340E7; Mon, 24 Jan 2022 20:42:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056976; bh=6V+sC1g13i8VXCbalZh08XyriymrAMskwoCmd6usGJM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KjwnAWiNHRzwriymVPrdQd2PbwLUDQASokNNW02Gzg37y/dP1GuzbQooC73Cp4+5f KDbhALck5c2tjQWCUJ7pKuwuLb3PZ2q4W0vnOmqEgH8UIucXeTdsyumeIrrABuUalK W0vLX25IB9Yu5lbstLkU33WNxmA6a9YXsFA6PlO8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , AngeloGioacchino Del Regno , Vinod Koul , Sasha Levin Subject: [PATCH 5.15 662/846] phy: mediatek: Fix missing check in mtk_mipi_tx_probe Date: Mon, 24 Jan 2022 19:42:59 +0100 Message-Id: <20220124184123.904083131@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 [ Upstream commit 399c91c3f30531593e5ff6ca7b53f47092128669 ] The of_device_get_match_data() function may return NULL. Add check to prevent potential null dereference. Signed-off-by: Miaoqian Lin Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20211224082103.7658-1-linmq006@gmail.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c index 28ad9403c4414..67b005d5b9e35 100644 --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c @@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev) return -ENOMEM; mipi_tx->driver_data = of_device_get_match_data(dev); + if (!mipi_tx->driver_data) + return -ENODEV; mipi_tx->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(mipi_tx->regs)) -- 2.34.1