Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2184706iof; Tue, 7 Jun 2022 22:30:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/DZ6df5DEZfTViircFjtDk84S4oNDwlMWEJCuywFRmx3VTq1iei2hAc57jJIx+ujh5+f9 X-Received: by 2002:a17:902:9887:b0:151:6e1c:7082 with SMTP id s7-20020a170902988700b001516e1c7082mr31589898plp.162.1654666237711; Tue, 07 Jun 2022 22:30:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654666237; cv=none; d=google.com; s=arc-20160816; b=SPtITdf91a8YrXVoG0sRzH0R0smI1FjgNAEcBa/fYspmk/etXmkXoKydkZbB5rKPrr Dd9j8GNOApqZyy3qk7dZXLcHBCqgc0zNzuybi23QLOoH2jXtCpzhS9aMilPwTNcv1iNq +2Dlm64TDl7NT7pLKtWEDnH+0zV+7949PLVL2dAwutZIrlolPqHBlIj7gq+k6Nslwnjz T0bQ6wyXynmrwzhHtwsv4/2kajopuNiHIJmIeoAaxf6Eiz9KXHwx6EhMvtVbdLWv13fB /A8igS9e3NK6h6D4pJG9UKFSPOWpFpZXs5Tqxq0FGkWfL8jG1y1pc89gzzlTm/90UShg 6Fvg== 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=+kmHr5+x3ZUK9eoeg61Nrl24BmZXVorbKD5bn64dT3c=; b=I3Tf4DiB7bAc38yBU61OglgbmOVcLJ7JK0mU0OOsUBdmTwdiD+RSNE9L2A7xvPnUTa JOjk+sRCLmrqJWyRQcvBDiRfScX8hDWdlmBy4P/isD2GMH3/7ODPexkyMFvdRfpBnIdu tXirRp14UuA4lzl6GnDwhHtXQ3S7NrOuLb9oMTBpFvewynnKtx3ZpPrkYkVMx34p9QEZ 4N1yOlcibUX2l5N0gPKmOpo7L8Pm1846ZimdTIs40wquCxOy8c9T9siGLLvGFYk04JHS sYU28IPND1FUiw9OsAT2MJ4kzQre/bUZeiKDs7d2nXEjPJCZbMSDqfajbs9oxFkmfcKQ WosA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZNV031xN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f136-20020a62388e000000b0051bd0d2dcaasi15509492pfa.109.2022.06.07.22.30.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:30:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZNV031xN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 04AFA48AB94; Tue, 7 Jun 2022 21:57:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383250AbiFGWav (ORCPT + 99 others); Tue, 7 Jun 2022 18:30:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380794AbiFGVQ7 (ORCPT ); Tue, 7 Jun 2022 17:16:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B179C2982C; Tue, 7 Jun 2022 11:57:25 -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 ams.source.kernel.org (Postfix) with ESMTPS id 6E76EB8233E; Tue, 7 Jun 2022 18:57:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D72C9C385A2; Tue, 7 Jun 2022 18:57:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628243; bh=l+KNCHbgVMmd/yIZZbjqm8gJi4yhr1wcah02wTfDYYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZNV031xN9tKDoklMlydq2Q2J6KlmDYQn9609QGRwJfsCEZqlwCJAGa9E+UN2k+GPQ 6yBSnWiPx2+0Ba58plVWGE9lEx9fvY3J3QbUWM5ghqbrFE3FZCubePZa1HTtm0nbRY 6oodKPSgSLi/Pb1hHSHk5zCYnjO24cj0cl8z1prU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Rix , Robert Foss , Sasha Levin Subject: [PATCH 5.18 258/879] drm/bridge: anx7625: check the return on anx7625_aux_trans Date: Tue, 7 Jun 2022 18:56:16 +0200 Message-Id: <20220607165010.338124319@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Tom Rix [ Upstream commit d583e752732421b26fef0d65020565f3bef12248 ] Clang static analysis reports this issue anx7625.c:876:13: warning: The left operand of '&' is a garbage value if (!(bcap & 0xOA01)) { ~~~~ ^ bcap is only set by a successful call to anx7625_aux_trans(). So check. Fixes: cd1637c7e480 ("drm/bridge: anx7625: add HDCP support") Signed-off-by: Tom Rix Fixes: adca62ec370c ("drm/bridge: anx7625: Support reading edid through aux channel") Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220303201943.501746-1-trix@redhat.com Reviewed-by: Robert Foss Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/analogix/anx7625.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 31ecf5626f1d..8e1851a57638 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -874,7 +874,10 @@ static int anx7625_hdcp_enable(struct anx7625_data *ctx) } /* Read downstream capability */ - anx7625_aux_trans(ctx, DP_AUX_NATIVE_READ, 0x68028, 1, &bcap); + ret = anx7625_aux_trans(ctx, DP_AUX_NATIVE_READ, 0x68028, 1, &bcap); + if (ret < 0) + return ret; + if (!(bcap & 0x01)) { pr_warn("downstream not support HDCP 1.4, cap(%x).\n", bcap); return 0; -- 2.35.1