Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3088750rwb; Mon, 15 Aug 2022 17:51:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR4QBGxKKMrV1SwI1yRiK4AQySSE/10zV0CeAiGgNgj2ZppFlOEGZpwoZlS0slYqfia8gn3x X-Received: by 2002:a17:907:2808:b0:738:596a:3bae with SMTP id eb8-20020a170907280800b00738596a3baemr3548679ejc.446.1660611074230; Mon, 15 Aug 2022 17:51:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611074; cv=none; d=google.com; s=arc-20160816; b=todgizF+x9zpyp7FZltiItufimPHpzmHd93IciTTLJpwXxdZ4rl85Ds3UYTbn6Kclz 9df1fjAG9YsR/p+toAF3wVIb2/46ml91mnJS9z46b63cWJGklP7JCp/bNmuS0VucYf7T a/WdMqwWnyrD7P+IyROjBNR5enL1nu/CFCfRt+eey8AOK0hk97NlDR4l5PzJ7rrJOxx6 /UbHdLxpw8+43MaAsYbEVzqK9IFKL7BXFEMzeAogoRYxVff/kez8RwJXI9c62C3V08g6 QrsdF7CiRfAdkkQsjV1GBuqKzPR6aHwjB0p2Oo1ztj0CIk2ZNH3XAyFIYLPpFknvdzgS c8Ug== 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=JCDd7Qd/uhVmWaFz0nd2esaS5MK8MUqxkpnhRg8Sqwo=; b=uLpOIeWyl610AXuTgGXWy2kiMMhCZtM/18PY0k6evy2nYVz56mxqVMlgOHxJBjSsRC eRcnJ68tCKebhzjtCa/RZpdnSTZ2zVfPGK3zIpK5xVdgRAEATdMplo9caY79g3yBDS4X LHvs/6x1k3tNKzG5FfKe2Av88zI9tZiXiVPyYdd3gvj5/7NoZg6Lo0IIGTDuVVJ6LUxy Vdpl/xMCxo1H2LmzSr/JHjRr6jwEoYte4ykHWnhImffwSK9dwLvr1Epe0GSbcdAb/auC Lp26u5F1/KYwacmQ4buTrYafp7kYJdt7spklwjme2vn0dgsFPB8EAAnVWn243q8PgaGJ Sz0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=j7w0nk1m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v3-20020a509543000000b0044301c6aca9si8730355eda.379.2022.08.15.17.50.48; Mon, 15 Aug 2022 17:51:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=j7w0nk1m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233290AbiHOXcW (ORCPT + 99 others); Mon, 15 Aug 2022 19:32:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344063AbiHOX0K (ORCPT ); Mon, 15 Aug 2022 19:26:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6108E80499; Mon, 15 Aug 2022 13:06:37 -0700 (PDT) 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 F088B60025; Mon, 15 Aug 2022 20:06:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F203CC433C1; Mon, 15 Aug 2022 20:06:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593996; bh=9/FwdszUVmHSP32BE8L/M81PIdZNgATYQgM69wIrkN4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j7w0nk1mfFhmAbdz5BKelKOU7I9jPFanJcwMy0sePnWerR9Z8RY6bVD7KQx7Zh4xG kYtJMDb6cgt/ArCEmL4QpieJr7upYLq3EWTL9nVyESTsdca0rQV7Ru0CLYr0sE4FJ7 Ccmw4EWe1cu5IxvmL2Pq65z33+JP/KNXn0Xsyb5o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "=?UTF-8?q?N=C3=ADcolas=20F . =20R . =20A . =20Prado?=" , AngeloGioacchino Del Regno , Robert Foss , Sasha Levin Subject: [PATCH 5.19 0359/1157] drm/bridge: anx7625: Zero error variable when panel bridge not present Date: Mon, 15 Aug 2022 19:55:15 +0200 Message-Id: <20220815180454.076004289@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: NĂ­colas F. R. A. Prado [ Upstream commit 3f49f7591e7150c502aa8d04354941ec2394153f ] While parsing the DT, the anx7625 driver checks for the presence of a panel bridge on endpoint 1. If it is missing, pdata->panel_bridge stores the error pointer and the function returns successfully without first cleaning that variable. This is an issue since other functions later check for the presence of a panel bridge by testing the trueness of that variable. In order to ensure proper behavior, zero out pdata->panel_bridge before returning when no panel bridge is found. Fixes: 9e82ea0fb1df ("drm/bridge: anx7625: switch to devm_drm_of_get_bridge") Signed-off-by: NĂ­colas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220613163705.1531721-1-nfraprado@collabora.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/analogix/anx7625.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 01f46d9189c1..0117fd8c62ae 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -1657,8 +1657,10 @@ static int anx7625_parse_dt(struct device *dev, pdata->panel_bridge = devm_drm_of_get_bridge(dev, np, 1, 0); if (IS_ERR(pdata->panel_bridge)) { - if (PTR_ERR(pdata->panel_bridge) == -ENODEV) + if (PTR_ERR(pdata->panel_bridge) == -ENODEV) { + pdata->panel_bridge = NULL; return 0; + } return PTR_ERR(pdata->panel_bridge); } -- 2.35.1