Message ID | 20231103-uninit-fixes-v2-1-c22b2444f5f5@ideasonboard.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> 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 <rfc822;lhua1029@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <tomi.valkeinen@ideasonboard.com> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Francesco Dolcini <francesco.dolcini@toradex.com>, Andrzej Hajda <andrzej.hajda@intel.com>, Neil Armstrong <neil.armstrong@linaro.org>, Robert Foss <rfoss@kernel.org>, Jonas Karlman <jonas@kwiboo.se>, Jernej Skrabec <jernej.skrabec@gmail.com>, Parshuram Thombare <pthombar@cadence.com> Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> 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: <linux-kernel.vger.kernel.org> 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 |
Series |
drm: Fix errors about uninitialized/wrong variables
|
|
Commit Message
Tomi Valkeinen
Nov. 3, 2023, 1:14 p.m. UTC
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 <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> --- 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);