From patchwork Fri Nov 3 13:14:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 161296 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1023220vqu; Fri, 3 Nov 2023 06:16:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyO78e3cSXCsbzHnlyMFcZFm55T3IQKCgBturxxM+6gyDc6V2wTGKegbLhE7Cow85DoqF8 X-Received: by 2002:a05:6602:154a:b0:7a6:8255:78b3 with SMTP id h10-20020a056602154a00b007a6825578b3mr31541836iow.7.1699017403638; Fri, 03 Nov 2023 06:16:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699017403; cv=none; d=google.com; s=arc-20160816; b=PPYFOKn7VW8BbIR3o8+zoN99bwCT7ZP1ZNjCN9jPS71Gopgn+E2SlIHcHRR2RnCGJU Og4AgZM3W+Tkur7hP6QMLb4+ahmoixUJh5Fxn+UetvpdqOtX1zwUVrdZZKn2rYoKxC/Z oo6uO8bf2f98s+2AYf2BL8MvA34INykUo10+Ie5h9b9yiET7YNomBBAs4DiMUAjQ/U3B k6Fh00w0zNbH0cL+Ydjojicj898MyveLe4xbvdlfbRUetyPW4895dU7rSPaN+hD4UGr5 dBeWPWpcgEHREgGtF8c2/KLCJFfudYyh7T4FszWKt/1XEk732eMlh9VOJfdC+70bYVSK XnvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=xMzxUNYi5+oaqehiVDES8TwgbZ2Oezi507fJdXGIdKU=; fh=0cAJsU3S0k7pAUOUcyB22u59h+m1QSgwv+f59I5MLSc=; b=ykY06RPCORt85sDtUEvLwJaqrzRqWrkF6VUZqZfbeJ5Sxn1jRcIMhx+43mW3vWKn58 cFQXZi8cPWikgxI7DafcATDH9aHYA6myEiskHJmrCu1iYjN+ZHGV5FKY+FJ7jsTmgeTg pam28xPu5tUCkk0OqP6oufaVyeBcnepZBPzajD479y4lVX/hwI+6sOwJUNxB0tswEUFb tHcxr4yQRIZAhk+ljbxJMKGidPBF6nf99BES+X6F+2YA/ZjcAst0FpTBFy1vX+KsbOKm HfQM9ksbueH5NFcgMoaOpAl2ip8jVE15cq3vLT25XITADxMCryrBSl/J1KPlGKtWmNTt i8Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=md8XVaGN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id c6-20020a633506000000b005b8f181b729si1471166pga.360.2023.11.03.06.16.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 06:16:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=md8XVaGN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 04A1F8070718; Fri, 3 Nov 2023 06:15:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233010AbjKCNOp (ORCPT + 36 others); Fri, 3 Nov 2023 09:14:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233088AbjKCNOn (ORCPT ); Fri, 3 Nov 2023 09:14:43 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BC7810D7 for ; Fri, 3 Nov 2023 06:14:25 -0700 (PDT) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 812957E1; Fri, 3 Nov 2023 14:14:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1699017245; bh=xvh2d5U42urNPpTVLrPHqnnQohefIEzDhgWLBqn84R4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=md8XVaGNJcNAoIJSUkmjHsee+W5rT7WUnAu/frOfntimOdTILaaPQJLnrC+s4+1iX kQYyAboeJy5Wk4wiUd5nl7G237ntAiVNmn1XLgZSon5GZBUrwsFua+x1UJ4ky6e4n+ Jx9bS6+pHMqQg6R/Ped6LrG30BGpEZQKaX4RB0ys= From: Tomi Valkeinen Date: Fri, 03 Nov 2023 15:14:03 +0200 Subject: [PATCH v2 1/4] drm/drm_file: fix use of uninitialized variable MIME-Version: 1.0 Message-Id: <20231103-uninit-fixes-v2-1-c22b2444f5f5@ideasonboard.com> References: <20231103-uninit-fixes-v2-0-c22b2444f5f5@ideasonboard.com> In-Reply-To: <20231103-uninit-fixes-v2-0-c22b2444f5f5@ideasonboard.com> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Laurent Pinchart , Francesco Dolcini , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Parshuram Thombare Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tomi Valkeinen , Laurent Pinchart X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1148; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=xvh2d5U42urNPpTVLrPHqnnQohefIEzDhgWLBqn84R4=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlRPIrnmZo1zjRKv5d2MoQWEqetAoew50nTwIqf 4dYQyqbaIqJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUTyKwAKCRD6PaqMvJYe 9deJEACAmhSvKQOpGftUEQRGJaU5QM4IipaLrzmOLtkoZklkMeFjdjFJL7fbrnKSeoOJkQL7kBA H3Y5ejdcQmxVlVhQ/DGg9LVBCDf+9mFIeX6WhItd6mUD7fCiqj0hjlRl8uiYxjEqLiz/mVwJW5e tBmZr0EMycBkMWL2Iczj4c2HVgyUEb3qo48WgOMOWy6w5+Ko0JLgOCo7SZieFzIJ3mtc4uGGCNK ouKC0bUqInXKHzq1PJWOGQ6TZ84OUO4oLXTwoMzE5LBtTNifsly1AI8ozSKeFEz1tVB+X/AiG7V 7UZ0Oz4hWPreJolS6miy96S+sJMuVtsHCb5tr5fieU1aHbnkZ56JK90nHoAbZ0d1N6Blvc3CsQE DmCW13ptjh868qfqsDoC8F2KQDPH7RqRTV7nLJD4lDmirRs2B0TTC3zd35sbs3ucsumS2Oavxr6 FDogtoqiLKYDgLsvk7ARbrpk+krN7N+hTKCnktHyWGQS90I9R+nvCZh+pj4S71aXc2+jWQiU3QH PHvdQcf8km2KSi9YPz2qtjFfHdMtCZe1Wb5TmESVPxBTg8BDIwKD+CXkNNZeOwILtQWI64I507H Eb6d3WQz11814zPUipjoO6D2vuyAuWb66JROZGUHO3gTm8ZmukiZBYrd8Ztfcqjh60CqjM98BcW 0oogiXp2RxzZEpw== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_PASS,T_SCC_BODY_TEXT_LINE,T_SPF_HELO_TEMPERROR autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 03 Nov 2023 06:15:11 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781548873292283468 X-GMAIL-MSGID: 1781548873292283468 smatch reports: drivers/gpu/drm/drm_file.c:967 drm_show_memory_stats() error: uninitialized symbol 'supported_status'. 'supported_status' is only set in one code path. I'm not familiar with the code to say if that path will always be ran in real life, but whether that is the case or not, I think it is good to initialize 'supported_status' to 0 to silence the warning (and possibly fix a bug). Reviewed-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/drm_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c index 446458aca8e9..54a7103c1c0f 100644 --- a/drivers/gpu/drm/drm_file.c +++ b/drivers/gpu/drm/drm_file.c @@ -958,7 +958,7 @@ void drm_show_memory_stats(struct drm_printer *p, struct drm_file *file) { struct drm_gem_object *obj; struct drm_memory_stats status = {}; - enum drm_gem_object_status supported_status; + enum drm_gem_object_status supported_status = 0; int id; spin_lock(&file->table_lock); From patchwork Fri Nov 3 13:14:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 161297 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1023251vqu; Fri, 3 Nov 2023 06:16:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEpY6BvBj9LGazgG7yydCt1RMUpz/S8W6j9msLjIAyT264GeUYxnHEZoXS5nHsAxSxMNWpi X-Received: by 2002:a17:902:f9ce:b0:1ca:a07b:36d with SMTP id kz14-20020a170902f9ce00b001caa07b036dmr18862365plb.48.1699017405527; Fri, 03 Nov 2023 06:16:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699017405; cv=none; d=google.com; s=arc-20160816; b=ay4Bg2R9HL+INZi0Iyyfrf8KdIt3f4t7h2V0mPbqmo2qucPsYO5kToXaG4huNixb4m ophfsTnl+4EdXC8cAQD4osWjTcBKdgEp/Q63rL4oo/NGrvhF9HQPdg9yaQTT4Bkcf7Mv S20pGB+GB3Ftk8sU2ET9h9MmOgdYnNctoa0jQiNQIIDtpG97wSVN2/a3XNV9Vg7/W2uA x7AMV4YTs4kLFGQ6SWs6nMtzVM8LiK7HLtmzIWutWOJXaSyHrP1yS8432f2WQTI4UQ64 VcRFz4dJzFA6lYj9DMD7K2jr+jyAq1kThKPyceBPpWeWqoNriq0gDjzpIRklb8Mb31IG xiEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=pjgpo2VA6t+XQQ6q7F+AJkWZyYa7oOMdA7W5DpZBlJA=; fh=0cAJsU3S0k7pAUOUcyB22u59h+m1QSgwv+f59I5MLSc=; b=jiF1g6xxrUfHst5Jm4JsGpHtMH0+5As0LkPSTWWVa0Rm79tT8Ul58VnnLAaAZ6y5F1 oFOFTkpPUFKm6kFgmcZaVGX1O4DieUpufPm6BkLYdZ++E0FWbJn49u66K/vRA2DUpf8Z tYKnr8SUXgjtfD6GyrgrHPDaDVDRvcR+aldkWNVaXXhNpCcBydH2pcsb+NV0gssSKxWb RY/+vEPUlZyHGOQBT2P8JmyBcLDLqdTAn4ULqPR58H/xJnHX7RQFInia/dx97MxBv40H yA67P5jISxW/UGK9kx4J1EZWXzHvewUxkOYuU4fXLRx+VGNBCvtWqXDk/cHs82vz1Axy Xjyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Ykodq0rZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id kf8-20020a17090305c800b001c427a74e31si1427039plb.628.2023.11.03.06.16.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 06:16:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Ykodq0rZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id F31698068210; Fri, 3 Nov 2023 06:15:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376554AbjKCNPJ (ORCPT + 36 others); Fri, 3 Nov 2023 09:15:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377627AbjKCNPH (ORCPT ); Fri, 3 Nov 2023 09:15:07 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42641D76 for ; Fri, 3 Nov 2023 06:14:43 -0700 (PDT) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 91371BEB; Fri, 3 Nov 2023 14:14:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1699017246; bh=zdGGDGGi0EjJoJXJD3OePDCfsWtgBRwsx7Z+r8jYoyA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Ykodq0rZICsxpK3As05OwmeuKKRSc7UhBzxtHtAgoOm44Sb6TfveAeBC3p2QmW4yG ItylLtyNGJK61KVKVXmLi80H+AjsLe4rAq4ffGIZE2uoJ442HwpM0uymsOZD6PaYY0 VKv/syGSd1uRc4UvJjkQHh6CpVp5BFGGjBQfeTM8= From: Tomi Valkeinen Date: Fri, 03 Nov 2023 15:14:04 +0200 Subject: [PATCH v2 2/4] drm/framebuffer: Fix use of uninitialized variable MIME-Version: 1.0 Message-Id: <20231103-uninit-fixes-v2-2-c22b2444f5f5@ideasonboard.com> References: <20231103-uninit-fixes-v2-0-c22b2444f5f5@ideasonboard.com> In-Reply-To: <20231103-uninit-fixes-v2-0-c22b2444f5f5@ideasonboard.com> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Laurent Pinchart , Francesco Dolcini , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Parshuram Thombare Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tomi Valkeinen , Laurent Pinchart X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1032; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=zdGGDGGi0EjJoJXJD3OePDCfsWtgBRwsx7Z+r8jYoyA=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlRPIsWu+CRgRS5bZtVv9evyDD5YSsgvRh8ehjM qDeOXjyVkeJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUTyLAAKCRD6PaqMvJYe 9XSiD/4qJVFOddephYbYFQsGjgjnyGoamkQnluXuBX09mIL4+G8dJth68eLvlTFnCaPAO9QwR5l 3TWv+SMFR5DDmlGn0tR3VrggNqPe2riOWGT2TAlpGtluD6a9Hj0hRmx+b8tL2WVXCjsGVFDB4Cn 8oQ9RcCVyiv50KWeBAF4gUoVYndSusuHH87eJjmvA4EXqU/m5kyqJLe+jeO+x3MrH8hC+kcLFmZ 9mUI069yxsthJFSZJjU9oSur684yA7FUdqCXBwyl1JcVLd3+LZcZyiVcmcp0amIOuTsvFZxPx7j KIeU44AQnLhtCADOFl02OKktxXEHi6B0q9Y82VGxZ7OlUvD+gTZnlLAoP2U5n7Ix0V5w7+FtdVR od6r1qIuVLDxvfNHEU+hGpJ0vdNpoFWCwphMVC4zp/O1pIxnzSDxIItIzKgh5mEkpFN+WXT3bwZ veocAeyq7iuxKpwdHXtqlEQVX/+ZWrUZOqsScRNjcVVG30ePi9ZRzZm8KSlJw2biyxXsMhcbRTC 9cIb6yrNVZfdYA0LbagOhq0xEejlJANNHVYxxrtyIU56N/yUCpzPwgl5R2h5hN+mFEpNMBto2IO dAgSjJBil93r3dnhCdE9s1ssyRYszqFnhgeRmj+o7gLeI+8UoBXeDh6onU+dh513wUEjGjcmR8z y4TZMtPPefBl00g== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 03 Nov 2023 06:15:32 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781548874963366962 X-GMAIL-MSGID: 1781548874963366962 smatch reports: drivers/gpu/drm/drm_framebuffer.c:654 drm_mode_getfb2_ioctl() error: uninitialized symbol 'ret'. 'ret' is possibly not set when there are no errors, causing the error above. I can't say if that ever happens in real-life, but in any case I think it is good to initialize 'ret' to 0. Reviewed-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/drm_framebuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 09e289fca5c3..3cc0ffc28e86 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -583,7 +583,7 @@ int drm_mode_getfb2_ioctl(struct drm_device *dev, struct drm_mode_fb_cmd2 *r = data; struct drm_framebuffer *fb; unsigned int i; - int ret; + int ret = 0; if (!drm_core_check_feature(dev, DRIVER_MODESET)) return -EINVAL; From patchwork Fri Nov 3 13:14:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 161298 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1023286vqu; Fri, 3 Nov 2023 06:16:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGOqEG37JtyGL6ShvFcL6seuHWW223n2lXsIVg9oCbyBtE41cnCsm6mqBIFqXpESrYdUEWo X-Received: by 2002:a17:902:f812:b0:1cc:4810:6f2c with SMTP id ix18-20020a170902f81200b001cc48106f2cmr2808571plb.33.1699017407574; Fri, 03 Nov 2023 06:16:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699017407; cv=none; d=google.com; s=arc-20160816; b=EWtgFFQxN2NoJ/jfugAcA1vFjepUKjiC2M3bCEaRPhRa/3KKgJaaPyWoBGndezeL53 rMefBAvzrPkivuezmdosNd0yRjxwHWkvMV3JCI16nOPxGu9YoGzskUxkOeC59n9HaRNM mrv13aoYh8PE3NCGtPLV4i/r5uj8H3bXebueX6nx/gxBcv/FrTaJz5igoMp5oO0RNxT+ kUfb0QEvUt0taA3EI+mXbR5fWEEkhBhGGGtHKw+KbuIhNfIw/xmswP73CrjPU6xRU0YU 7Ljyo2Cvkfca5wYi/m3pRyT8G3An542UNcktsa3lXZVO5uxbFRR1BQFCJqzmN+RZqzlO gSSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=R/ypA7w/UPtifimAFVLBbVWfR1yUN5cZnosivFcW4Ok=; fh=dmgf1zKZhB/q4di8sVBSEfmJWDNrFAoGueAGci0ESTg=; b=GlY0ZWarC3nqgk+NeLxqTCfPx17mYK3aB+TG6Tp767ozFsAGkJN5q4KdgQnOR74f3m Us7f4R2+agqlS3nU/Xe0SirrCkTvkiv7pZpX/18wHPMO8nBVPdIPm3DbRwsdMPLcp9jx W76su8WoKJYac/GztXKjo+kKJsz5SzGI1a8X0e/e+k+BORB6O6V17Icr3YEmLGSpenbY 1kIM+Etcs06UPxDNHQ9OowhEoCe9GqIFhXx0W8qAsNQoXJ1GVcX8KxCl02zSQqNyIHoW M2IfFU36omLC6tHfsATZKuuABVIKv6lGQfAjs8eUp7Y8p9XMtegyRvBkaRiftVD86lVI Iwfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=t1lT52Pt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id lg8-20020a170902fb8800b001ca7308e42fsi1430526plb.631.2023.11.03.06.16.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 06:16:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=t1lT52Pt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id B2204801CD8F; Fri, 3 Nov 2023 06:16:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377653AbjKCNPN (ORCPT + 36 others); Fri, 3 Nov 2023 09:15:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377655AbjKCNPI (ORCPT ); Fri, 3 Nov 2023 09:15:08 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92EBB111 for ; Fri, 3 Nov 2023 06:14:43 -0700 (PDT) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A044A1AB9; Fri, 3 Nov 2023 14:14:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1699017247; bh=GfkdOn7Nflp8EiHOQgGZ6pujA7kOojVrCOcgPLu3P0U=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=t1lT52PtrE29xwCBZBAGorMm/7OJBcmJZsf7CyobzPjEikNJsb1J2f+0zzZDgxjwt Ov0gfsVYyt0qNuYd8s61xVp5gBrVM5BV7DabtsmhuCQhLKfW93MBYpgGwD4EDqr8IF UVNrLVGkqze7OqENw8pwm3yaIH0dX1tJGuhw13Gw= From: Tomi Valkeinen Date: Fri, 03 Nov 2023 15:14:05 +0200 Subject: [PATCH v2 3/4] drm/bridge: cdns-mhdp8546: Fix use of uninitialized variable MIME-Version: 1.0 Message-Id: <20231103-uninit-fixes-v2-3-c22b2444f5f5@ideasonboard.com> References: <20231103-uninit-fixes-v2-0-c22b2444f5f5@ideasonboard.com> In-Reply-To: <20231103-uninit-fixes-v2-0-c22b2444f5f5@ideasonboard.com> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Laurent Pinchart , Francesco Dolcini , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Parshuram Thombare Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=946; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=GfkdOn7Nflp8EiHOQgGZ6pujA7kOojVrCOcgPLu3P0U=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlRPIs0SWDfuK8Zd/LgHa0XySY6imSV4EQKxyEL UP0dzp0Q0aJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUTyLAAKCRD6PaqMvJYe 9ZVgEACiOAnK10hGiar77wl9mNm1C0ZbQwD9cD9Q1GmjqtoRX4o8sbE2QIdwqWcYH+h2/8xk2QZ 8vhclDAAzwrzhlcc8gv4CR0GttdiT7qu0YKQ6itXkznnggoOn729zetwzNv7RK2zdjFgkYt5ojn 8C/3R7Z5XViGe2/sWANvoqKAYMMxu/AiTosLZ3vDmKHUnEGVjXGoFmAmIIHuHa23GmaaJvEfZjT 26ojKddVhJgpbUcKcRsHnpOfs3isr2DAf4lKcAP7YgBKuR1CasFp9UIrXZEbL8vLCmgtO4vqOCy wmKGv3GKLdmtwYWiFzRU4VFfHee1ojPdUjGrCVQK5I5p6q6H1Qo1uFEG/M4218mYxg6Sk1mbY4R Uq6mPx0HIfXnoEDxrJDlyr3HY+h/N89xQbV6FfGNCV4uY/hCd/+F7rumSfkwqpeDez5ydJPj7Q6 Ia4SUMM/0+AblLDkgmXcKiRg/xpN4tugHGDlw8qKjCVDFddslZ5Gs45m3+dXZiu1KdgWmhYcKRO odpUk3w+SWLmpth1kjF6Jr6M808kkZnNOfOdjQsL9SNKDV6QDTE7jtAWuVUougt24UHUILv0KNS 90DZiqnnJ8znmWjm73QGJqirPHxJITAukk5Rrs+oMJ0Polo1BdqmuSsabsO7npmIMIVoPwoR261 LCljNMeK7DL83Wg== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 03 Nov 2023 06:16:06 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781548877218183843 X-GMAIL-MSGID: 1781548877218183843 'ret' could be uninitialized at the end of the function, although it's not clear if that can happen in practice. Fixes: 6a3608eae6d3 ("drm: bridge: cdns-mhdp8546: Enable HDCP") Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c index 946212a95598..5e3b8edcf794 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c @@ -403,7 +403,8 @@ static int _cdns_mhdp_hdcp_disable(struct cdns_mhdp_device *mhdp) static int _cdns_mhdp_hdcp_enable(struct cdns_mhdp_device *mhdp, u8 content_type) { - int ret, tries = 3; + int ret = -EINVAL; + int tries = 3; u32 i; for (i = 0; i < tries; i++) { From patchwork Fri Nov 3 13:14:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 161299 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1023294vqu; Fri, 3 Nov 2023 06:16:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHngF5oFXc6eynpoMxRNrL8krfcHoBGNI9EjN4mk1vJ8d7ScR8puSiXRsSufCCYrppqilpU X-Received: by 2002:a05:6a21:7742:b0:181:3dde:deeb with SMTP id bc2-20020a056a21774200b001813ddedeebmr8973134pzc.33.1699017408599; Fri, 03 Nov 2023 06:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699017408; cv=none; d=google.com; s=arc-20160816; b=j4vr/kT1Ql7xh12rz9ZHtHUKx52tQTMsKTqg6D8n94w4DCDb0IgBvAGo6VzGs32qSs JGic+Ab8Qz4YdLIt5W7ohN2qqSdApMszdcwglIK+IEGBil/APEgTTnDZ1sH9e+tYw9gx tgcg3nRdcIxNQ6TdUX/nnKOD0KPEb2d41dnVxf3Svzz1DZ5Br/iBQ088N5f1aXteup+g MigxCLP4ozj9CMBnHQIO/6Wl6AF/TnBfXrS9tnAlT+GTtCNrRPmOIPngUmqKAI7X5uFU QG7KKp+BsjhPDNRKWJjKnnPkCxzBEMADu14TQif878j0BQQFkp+8sOyOcarDhbVRHIor BM9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=MZQ2cgPmJpqGaoPi7di1fjHvFGq+filW6kF8Eudrk/Y=; fh=dmgf1zKZhB/q4di8sVBSEfmJWDNrFAoGueAGci0ESTg=; b=eitRS0ROtMN90BlReXQJmPXwtbJ1l2NJ74es40HnxBqG/LtnAI+dICs7MBn1JrA2dF I73ga+utBKgwAa8MAvmG6hgHDtQictmXmzEwbg0dUaThzcc6XhJEDl2wxidJnqoOcBz+ 1AvkXfhwgBdUXH/23pq/DkgYxY7SJJbUvJ1y9LLv46oImMZONsN/FMVQ86Pg8L0A/WL5 LqkM6FPq0+J8KSnTWz3pt30nxTIviJadx+d4TJzqdzBzQl6PWJ9y/9rZgNY4lxUnWK1E uki0MFFVTIXV+qnlmzZcxfOleOL7+CaZVMN1Ean1HpnwB+Gsgft9YtqqQYNKM9rNUrmQ 7nOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=hCYpRxxV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id ka24-20020a056a00939800b006933e8fec67si1532747pfb.227.2023.11.03.06.16.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 06:16:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=hCYpRxxV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id BED758283A38; Fri, 3 Nov 2023 06:16:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377684AbjKCNPb (ORCPT + 36 others); Fri, 3 Nov 2023 09:15:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346906AbjKCNP2 (ORCPT ); Fri, 3 Nov 2023 09:15:28 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC5E610E5 for ; Fri, 3 Nov 2023 06:15:06 -0700 (PDT) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A21001B3C; Fri, 3 Nov 2023 14:14:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1699017248; bh=/YMvSFyCzcoztqCvEfSKeF9x2o+k/zCSCqmAdPdzVO4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hCYpRxxV8PjHjoFcF+9rqbCN4DIlOabVHnkAPiROD0z9nLynmkbOGrruqtrAhPjv/ Z22umNd1TvTs/tpJakQQqru8FERq4FVTmL7Dixy26UIHvK0FNIome8u1QFRu+aDjcL xq3e/yUkh701BbcQrT4ZVDfq8HWkozWcrJdFbPew= From: Tomi Valkeinen Date: Fri, 03 Nov 2023 15:14:06 +0200 Subject: [PATCH v2 4/4] drm/bridge: tc358767: Fix return value on error case MIME-Version: 1.0 Message-Id: <20231103-uninit-fixes-v2-4-c22b2444f5f5@ideasonboard.com> References: <20231103-uninit-fixes-v2-0-c22b2444f5f5@ideasonboard.com> In-Reply-To: <20231103-uninit-fixes-v2-0-c22b2444f5f5@ideasonboard.com> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Laurent Pinchart , Francesco Dolcini , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Parshuram Thombare Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=820; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=/YMvSFyCzcoztqCvEfSKeF9x2o+k/zCSCqmAdPdzVO4=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlRPIsY9zBPyFLRFuuV2diqQVeV3190D+UyXLZ6 fMQe8myRu2JAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUTyLAAKCRD6PaqMvJYe 9beOEACkjxvj+96UcRM4CbLrb2joKUEkDxw0OQqhopsLE0298zI6t3N/YlL6ppKwaI1Eul01OTm oKxiwaLaJeq4VWtPnvbhifeRc8R+QsiIAiusWN3sSv4oaerK/58fscS1mnLuu38Gwr/3jv31fqS kk8vqGAVO2H7oNvCndE+tSq2JPBxkwdLeE9QF8/kCXw2DM7PnXb4xmYr4HhgH0vfDfUDQ+2Ct8Q Xjqg8mDkNKA5DcgYDWw0mpxMAH34z2P6qgEoW/fDTUGM5M4Dcbkp+LmDIEkNEZ/W0C+45wQ51hh nd2bvwUUSDatEQjw9Z6Z1VGanDGdfI8NzdGxd8iCCWyRPm6vIBKZhS59onpsjaLUrA4d43x94jO 4qxOybMkArBWa4IQfu6So6IFs5s8ksGR7w4nrLbllTwIBLSWyIyjvWmLdMCrTeBkYP54iNyhnLZ pTwTl96uR8cAh1Ip/ancXyqNP25L3BnUxJRgdjdpWqcv28Oi4pRFk0oYUihUlbCDEV/fv5L0XU3 PP0bgZF5V+b0cH07xOejOnGMMcHT0Vf/dmatMReuyNliIKrZeBD60ZrYIEHQCPRJv4WjVvhH94P qr+nARHVKkQtc3hCraX0RjnuS6WLjY/affhn9X5hu57k7zqGjxgscc+XJFnZgoyazJ7ZBkvrIdm DEwdDpXKnSEj7Mg== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 03 Nov 2023 06:16:21 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781548878174105305 X-GMAIL-MSGID: 1781548878174105305 If the hpd_pin is invalid, the driver returns 'ret'. But 'ret' contains 0, instead of an error value. Return -EINVAL instead. Fixes: f25ee5017e4f ("drm/bridge: tc358767: add IRQ and HPD support") Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index ef2e373606ba..615cc8f950d7 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -2273,7 +2273,7 @@ static int tc_probe(struct i2c_client *client) } else { if (tc->hpd_pin < 0 || tc->hpd_pin > 1) { dev_err(dev, "failed to parse HPD number\n"); - return ret; + return -EINVAL; } }