Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp470047rdf; Fri, 3 Nov 2023 06:15:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG4GxDizHeZC6SZlHN6bxaxt+ZNFa1/ihxHxJfjVR+eTCv0Kdx70gnKwV63QB/r1W31OmfU X-Received: by 2002:a17:903:2808:b0:1cc:31c4:377b with SMTP id kp8-20020a170903280800b001cc31c4377bmr13829626plb.63.1699017345190; Fri, 03 Nov 2023 06:15:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699017345; cv=none; d=google.com; s=arc-20160816; b=0k1febvgT1XfSZXO1l7Wr01JY76lFPtKfG/po5EhZDyQxdoFZ+r9Ai6/ivF0ReFJfF l4kBVf63wu+UqmFUvkmWu4UAlJQoYF31eLxxus20UFG+ja9m8ffcC5iY7YY/UYYuBe31 7HtEdEfQ7Bp+C28kL6AJWVDT0JJykBYAVJ8nIFWkxFECAs27ssHrccI83AyzuThtFRoG Pk8aVPAmfYUsSIp7L0IeoAUoAUdsoj/W9MU985islS7Dt6dYUl6nPV5X5onklD7ftsWL hz+Po0eGsyxajhnrAFCovix3Lc8a+x1KpRbuu5wHLn1dwtF9+oyQPcKYOQxrljnBYrfP tCgw== 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 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id jx16-20020a170903139000b001bbab2e5a27si1455572plb.290.2023.11.03.06.15.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 06:15:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; 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 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 595FA8299E27; Fri, 3 Nov 2023 06:14:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346901AbjKCNOp (ORCPT + 99 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 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 , 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_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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 03 Nov 2023 06:14:57 -0700 (PDT) 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); -- 2.34.1