Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp785864iog; Mon, 13 Jun 2022 12:58:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdklWi4TExoDLa4/XHedXRECKOSUaCMKtH6WJWXbyhnD8KoiC3l1E2fa1z3qP+dKZIdvdT X-Received: by 2002:a17:906:51de:b0:712:23e0:df84 with SMTP id v30-20020a17090651de00b0071223e0df84mr1222499ejk.453.1655150289718; Mon, 13 Jun 2022 12:58:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655150289; cv=none; d=google.com; s=arc-20160816; b=VP05EpwVhzdmfPZ3VDLvAADy6+jg/y9WE2vJYx9epo62dtefQXMuld/STxBfqpKjsG MesB/pIZEkMdhi7F7zFuhY1nNnvNpPfjI1Hp+mMbkhoX5jaqh5Ttx57OVdkxp0MqZrmX KIifbIXXk9HOsdCQLgHxgRUrFmsLNlvU5mFzOoJegUpq7RHYDLeUZxhaMYz0OQbWU9Mr gwTV6vgoClBUCCcgxoGUhc5bQ/8gzxq9g3OsOT2veTH3DiaD5uHJV9AQlRV5i9C2lBxi dtPIeYIlWVeUsG9gFORAJGXSR0TedZKwAPXBVDjmU7tgYnLAAvGCP6VMPN8O6HTYU4o4 D4eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=b6LI4jSTppnwbn/7MHPjsmN7q6vhTZpE2X7+c7LKVK0=; b=ifn6BVtXIX+Ye1q9e2t02qmA6M20PtuW+00f5OY4GiZpLL1KHdczm/yFAZ5lnGMZf3 JdNaHXegf8PBXeQsb332JYbMCEGfrrX7GmyuGF6a5egt30MCKMhkxQTyWoC4Qm/fan11 RN1otvnuvwOl6UjJ94uKc2PIbCxT/x1VSzICdnkEmDKLf/JxAklfO6nBgDwq2rQSu/mK 9HOo830PKivE0Ez9lgwVjjXmi05oNULjiGiCckpagehBgZS3DoISEAWq7TwYr+GoJwAR /pbD52y62KIEvlJSfcCWpBX+dSTYC4+g6h+gIWJM6hLzUTpYNzKTy1McexJHUVBJ4Jay rOQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TjSewGIw; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q12-20020a056402518c00b00423709edc7esi9394629edd.529.2022.06.13.12.57.44; Mon, 13 Jun 2022 12:58:09 -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=@gmail.com header.s=20210112 header.b=TjSewGIw; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231962AbiFMTQu (ORCPT + 99 others); Mon, 13 Jun 2022 15:16:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346255AbiFMTQS (ORCPT ); Mon, 13 Jun 2022 15:16:18 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 131EF5FBD for ; Mon, 13 Jun 2022 10:31:04 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id h19so4784530wrc.12 for ; Mon, 13 Jun 2022 10:31:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=b6LI4jSTppnwbn/7MHPjsmN7q6vhTZpE2X7+c7LKVK0=; b=TjSewGIwP0DCjp2l8QRZYjpF076U4CIy6nnYCGcm+6wAHhgocXZcndKQ01Sjwf9Z9x aXsRs94nQKH5njHHI5X7xUl9u0+ErvEIIcs8zmW47MyZ+dMJZxJ85VMQeFMaNCAD7vy3 2ELYlJ9/lA4/XTMg+JlYX2JAu6BTqdSCb+uilS5l4cRVuQ8ixXvoQHC9Xp9/sVcMQxhZ 35ROofq60l6F0c8S4Ebs/EkepuPtAh3ZzaZcxkoYYHjC7CFnab4ZQp0ZI7ywJZT3HeAZ YsajnPx8xEl6dED0MwsybEwHga8p1kd/sdmv+pyhisG6Wj9drHS0aIFJgwWat+9CyjoY NCWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=b6LI4jSTppnwbn/7MHPjsmN7q6vhTZpE2X7+c7LKVK0=; b=BNmi1AvuaLeRxqslSDWoBQhhINrP2LS69HDtzXjq3iUxmkIAXnbiaKq/AfC3DJyKpC 5z0by4JMSwIyyRxFKQU5NevWHeJIvmthEkTj4QdGJgwjMlHH6lQBri/y6MBAqymV2ptr MBOD7MY+/vqJq3j5cZFUA2J/l5CfUM5vuxKpjTThH/S/e3ANJZ6AsoiLsE8d9/dokZJB 2AkgEGai4PTMQld1i/QZfzfhvFS43GSsH39OVKhdy24B00nx0rW1WWNiOw2JccJgMZlX RgsFPs4oWbnOnP7KdoHJjKU8wi/DUvNEGyqXFmv1/nRY4XsLEljIdk2Fs4Aorw12OQoT sqWg== X-Gm-Message-State: AJIora+piKsnOZ2QcPbzTBIX8y3q+r7an5wjJIXBnT99iSkPCXya5JGg sYnQEs6ZJNCYTp3yTt65Dkg= X-Received: by 2002:a5d:46cc:0:b0:214:2d66:2d51 with SMTP id g12-20020a5d46cc000000b002142d662d51mr886667wrs.349.1655141462582; Mon, 13 Jun 2022 10:31:02 -0700 (PDT) Received: from elementary ([94.73.36.128]) by smtp.gmail.com with ESMTPSA id n4-20020a05600c3b8400b0039c5224bfcbsm14479675wms.46.2022.06.13.10.31.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 10:31:02 -0700 (PDT) Date: Mon, 13 Jun 2022 19:30:58 +0200 From: =?iso-8859-1?Q?Jos=E9_Exp=F3sito?= To: =?iso-8859-1?Q?N=EDcolas_F=2E_R=2E_A=2E?= Prado Cc: Robert Foss , kernel@collabora.com, AngeloGioacchino Del Regno , Andrzej Hajda , Daniel Vetter , David Airlie , Hsin-Yi Wang , Jernej Skrabec , Jonas Karlman , Laurent Pinchart , Maxime Ripard , Neil Armstrong , Sam Ravnborg , Thomas Zimmermann , Tzung-Bi Shih , Xin Ji , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/bridge: anx7625: Zero error variable when panel bridge not present Message-ID: <20220613173058.GA132991@elementary> References: <20220613163705.1531721-1-nfraprado@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220613163705.1531721-1-nfraprado@collabora.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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 On Mon, Jun 13, 2022 at 12:37:05PM -0400, N?colas F. R. A. Prado wrote: > 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 > > --- > > 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 53a5da6c49dd..3aed4de16690 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.36.1 > Thanks for spotting this error N?colas. As you mentioned, prior to 9e82ea0fb1df the "pdata->panel_bridge" pointer was not modified (i.e. left to NULL) on the ENODEV error branch. I missed it during the refactor, sorry about that.