From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 771CACCA47A for ; Tue, 14 Jun 2022 07:53:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353151AbiFNHxx (ORCPT ); Tue, 14 Jun 2022 03:53:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355539AbiFNHxV (ORCPT ); Tue, 14 Jun 2022 03:53:21 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C619640E76 for ; Tue, 14 Jun 2022 00:52:16 -0700 (PDT) Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id F2C4766016A5; Tue, 14 Jun 2022 08:52:13 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1655193134; bh=YiYxfz9UJYMv0Yzl92YcMKOgxfk4MMa4/uB2sRksOJM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=UUod8iVfxYNNRG93+40eRBJxUTQ3ZMgriSgsL2pjQ7TOiQCiDUa9nUiDsYxWRkP1I J5w3HAl/BXe/Q6B6GwMcl3f9CawLTS2jXqIIot2MCzgKx1VFkVC0GNtMAC6dwA2sDu sEDwNJugHElihkizTLODY+vFVbqAyo2Nc0A+SANM34T/+FBJEumOXIHLvqCqkGORER 1n53h10MPyNSaoBd/YmIETwznwOUFBZEAvHx3Flg9n9RcaFEA42l6jXeKo+8jwHlhJ md6WWZoS6XWPCD3fJHg9pceZe1BIdNxOqZ1IZUCGa5AbcJ7mX8a4xoOH/xSH5aIdN5 E7/yJ3pSnhAkQ== Message-ID: <9c8c712c-75d1-bd0f-0205-be769ce5e83d@collabora.com> Date: Tue, 14 Jun 2022 09:52:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH] drm/bridge: anx7625: Zero error variable when panel bridge not present Content-Language: en-US To: =?UTF-8?B?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Robert Foss Cc: kernel@collabora.com, Andrzej Hajda , Daniel Vetter , David Airlie , Hsin-Yi Wang , Jernej Skrabec , Jonas Karlman , =?UTF-8?B?Sm9zw6kgRXhww7NzaXRv?= , 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 References: <20220613163705.1531721-1-nfraprado@collabora.com> From: AngeloGioacchino Del Regno In-Reply-To: <20220613163705.1531721-1-nfraprado@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il 13/06/22 18:37, NĂ­colas F. R. A. Prado ha scritto: > 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 > I would've preferred s/zero out/cleanup/g but it's also fine as you wrote it. Besides, good catch! Reviewed-by: AngeloGioacchino Del Regno