Message ID | 20231103-uninit-fixes-v2-2-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 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 <rfc822;lhua1029@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <tomi.valkeinen@ideasonboard.com> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 <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=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: <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:32 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781548874963366962 X-GMAIL-MSGID: 1781548874963366962 |
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_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 <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> --- 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;