From patchwork Wed Aug 18 17:13:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foss X-Patchwork-Id: 498914 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp866716jab; Wed, 18 Aug 2021 10:13:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5F6T5Ip4j408SXC4yqVRsEHJ0UZ2V0oBQeVp54AJYDAeuVwvfdcxMk0dzhFViE4Ub2GbL X-Received: by 2002:a17:902:8606:b029:12c:2625:76cf with SMTP id f6-20020a1709028606b029012c262576cfmr8184590plo.17.1629306813868; Wed, 18 Aug 2021 10:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629306813; cv=none; d=google.com; s=arc-20160816; b=s6yGqP1R+bKkKAyW//ExuUfzE/0lUUjF4LfO/mHRHPrRvb3CZWGdvAJfepGm+7jzhr hMsUhE1C4dBb4mDbyGSQSDCBiJvYMooIWJRiZRmAETi1cQdv5dvuKLJnaue3oXEhhRMz /ZZY2/QvVWJMMPUNqO5RFXOJ3CedWtcSsvAYvlb2gBtepKoDA56Mtw25NKwMtdvDC+71 mll143KxbJUbibzUB3u/8jryrwJz3xPeDIx+xHMJio4fITVdQ8NK2sgYsD7sNnkCUQX3 gqpI34jhIHzHmBm6o1Q6NEFcO+RG/3DFdTsMB74c/UyYWlir64g2hpBjFlIAzAu6Gmvt z2HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=37MLSH9lYPS34IVx5EfZVMr+hGfCcZBIMSeL1QJmzSc=; b=IaRyyULUugVp5yFwqWYagJQnO8Y3VTVs4NQVgDsWA90zVYXRjCRoYhIEWjFbkfHvjD IZ+jLJvVw/Vi4D5fvrMMA9gmza1AfvZLum9yjKAxI8YCJVlhvaPymBMlU3eGXMwCn9ha pHek4Tw4sSQADvk8aSY63CTeSBumNkmqW3OT7yZdQBRzUIWv2ycGet+jpGMPOx8CdQoJ BmHdj0RIbC2/6Ud/o7ZmYQMR54WCnN9Yg5K4tPlPmkakAclpbBshrLXEvjDgnCAjXMQz JA4qZ819VUcjsQBDbwgasjliXJvNKvNCPBPilZ/qLmuKEy701EKeyRrexMAMrot1RVdC ifYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PIOS5lfV; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id h7si442784pls.86.2021.08.18.10.13.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 10:13:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PIOS5lfV; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 992AF6E876; Wed, 18 Aug 2021 17:13:32 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by gabe.freedesktop.org (Postfix) with ESMTPS id 05C5A6E873 for ; Wed, 18 Aug 2021 17:13:27 +0000 (UTC) Received: by mail-wr1-x433.google.com with SMTP id q10so4659967wro.2 for ; Wed, 18 Aug 2021 10:13:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=37MLSH9lYPS34IVx5EfZVMr+hGfCcZBIMSeL1QJmzSc=; b=PIOS5lfVqZQr2EIMeZA5ubQx6UB/nEqDdg+/fw3aomNSZcT13tMnYoz+UIqXBDb6hq LbjTjXYx9ei9CZ8QrgFcEPWwOCqQ3XtbtRBUdQippNZGFaTaiaKYECYt17KNOPsa68+S gxHxVI4lvJ95gY382yCB32K4aidQiVFAiYsbXsMajVYG23sN7gBFlTqgd8jhGyOUdLOr hi2R8zoeWiTFrxtNgMcs6x9eatE2RgySYXH58fGdKep1g1vJ00d6l9dXimjCNfFD2uWz h0CUUdmtIUsahSWQhSAUJmuB/Wq7GsujSUEYNvkCLzJgCTvTQgOxVrfxPQTx4RUvmMim kM9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=37MLSH9lYPS34IVx5EfZVMr+hGfCcZBIMSeL1QJmzSc=; b=PvzyhMQchYfwe65w70P0hQJ9C0SUDSCAbJKFLA6X4KDfJv8YWHue2WWUO/1hBRnFHv n5N6yuSl7GVx1b0vU/vYHJJIA9hGgwURvxfh/r7+TtP6ozzD9NasWuSmxSJXqvbxy1q/ wXDl2EvD1qIv2rUg4Dz6jBWUf+MTmMHxjx2cMAsb+63WjHoWUJb+qts/rPgHolzU2Fvz GLd9LaS3maDDjtb4XloQ3jc40wTfjV16ArcSYTEyqQV/QPAKSZbd9opxw3yDY6LKTYs8 Cddu1SHDktyVOCDM4R1EZ6mzP4HyciIYHshy/Yeu98IC9yXMZaiXjoFZ9rt9dKlq+X3x J11A== X-Gm-Message-State: AOAM533OSjP+JGSg1y8PoiEVfRK5bxf3XIJURlgiXcBTfaP2tTodOe/n OSVXyQ+b0UvN5ad6lgdSTf93YQ== X-Received: by 2002:a5d:620d:: with SMTP id y13mr11854422wru.45.1629306806404; Wed, 18 Aug 2021 10:13:26 -0700 (PDT) Received: from xps7590.fritz.box ([2a02:2454:3e5:b700:a470:eb9f:53a5:20f8]) by smtp.gmail.com with ESMTPSA id p3sm414825wrr.21.2021.08.18.10.13.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 10:13:25 -0700 (PDT) From: Robert Foss To: a.hajda@samsung.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, xji@analogixsemi.com, pihsun@chromium.org, tzungbi@google.com, sam@ravnborg.org, hsinyi@chromium.org, drinkcat@chromium.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] drm/bridge: anx7625: Propagate errors from sp_tx_edid_read() Date: Wed, 18 Aug 2021 19:13:18 +0200 Message-Id: <20210818171318.1848272-2-robert.foss@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210818171318.1848272-1-robert.foss@linaro.org> References: <20210818171318.1848272-1-robert.foss@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" During the sp_tx_edid_read() call the return value of sp_tx_edid_read() is ignored, which could cause potential errors to go unhandled. All errors which are returned by sp_tx_edid_read() are handled in anx7625_get_edid(). Signed-off-by: Robert Foss --- drivers/gpu/drm/bridge/analogix/anx7625.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) -- 2.30.2 Reviewed-by: Sam Ravnborg diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index ea414cd349b5c..abc8db77bfd36 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -845,8 +845,11 @@ static int sp_tx_edid_read(struct anx7625_data *ctx, if (g_edid_break == 1) break; - segments_edid_read(ctx, count / 2, - pblock_buf, offset); + ret = segments_edid_read(ctx, count / 2, + pblock_buf, offset); + if (ret < 0) + return ret; + memcpy(&pedid_blocks_buf[edid_pos], pblock_buf, MAX_DPCD_BUFFER_SIZE); @@ -863,8 +866,11 @@ static int sp_tx_edid_read(struct anx7625_data *ctx, if (g_edid_break == 1) break; - segments_edid_read(ctx, count / 2, - pblock_buf, offset); + ret = segments_edid_read(ctx, count / 2, + pblock_buf, offset); + if (ret < 0) + return ret; + memcpy(&pedid_blocks_buf[edid_pos], pblock_buf, MAX_DPCD_BUFFER_SIZE);