From patchwork Fri Oct 20 22:52:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 13431280 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3E92DC001DF for ; Fri, 20 Oct 2023 22:54:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7816310E609; Fri, 20 Oct 2023 22:54:05 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id D371010E609 for ; Fri, 20 Oct 2023 22:54:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697842442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qFRLhmS2CQCqNG3Gndm1rIdWDDyvH+OTofhMbIHOAf0=; b=H2KHvoOv4dz2kSS5dd5hOPGIifuDDrXZAHEUzbYLdJkFxEABPCNriFGNKx4UdCO34WeevQ Am2o1jb8nqGgFBIsKWt/SpIaRp10cbmKEK/vulK4bxwH1lo4CYjCR9BZIJFRYgjOaIW9O9 fYStawIl/E46VkLxelc5aKREq7Ro3+A= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-249-fAEBrhqNOKmNPmNnbcLMvA-1; Fri, 20 Oct 2023 18:54:01 -0400 X-MC-Unique: fAEBrhqNOKmNPmNnbcLMvA-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-32db43129c6so647494f8f.1 for ; Fri, 20 Oct 2023 15:54:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697842440; x=1698447240; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qFRLhmS2CQCqNG3Gndm1rIdWDDyvH+OTofhMbIHOAf0=; b=Xvg80UsV5RKF6EcpOSVAiyeBoankE6h4CarDfQXLCh7sn3gwytGx9wrepvnP44WSZl AoSTYuAr6gdFpjk8h2QDV/ZUS2qcr0Dtye7e/SO8t0aZj52vyinmVvNiRdMAVQljO4cc 8f0GmJkgjwJDWtysyQoOWBb5tGZ0DS0lBvPaNFoo37ea+QOXlpZnyax2SrL2hiEp7WF0 S9NyOpUTpP6k21BDFC3gl3a0WcfBo40CZePPDUBgDLD9i7r/OdUFWeEv+wj9Ds3gWAzn FkCx38PVxuNWabhVM7fJviLaj4cqlIzQ1ZXSMW+/2rJDRhU0r237kgFvHRI4sPoOfbu7 1vwA== X-Gm-Message-State: AOJu0YyfoGQetC4qMpEBKm35DMAZsPETVJ6LXiaheP+pj9WEMYxpW8oH yy8VymQY6tSvihwqzcQBLP6Iy2r7m/ctjp3W/8f+BlzuvNKt7XlU1pou0pcwS60WPfVvHnguPnh DvW/7bzStGvzsuEL9KEZdgYcWZHbl X-Received: by 2002:a5d:58ea:0:b0:32d:819d:ec75 with SMTP id f10-20020a5d58ea000000b0032d819dec75mr2386181wrd.60.1697842440519; Fri, 20 Oct 2023 15:54:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEokgbV7EOSbvHnFRW97a9AjS0odPg33+dhDQZB4Y/IUzZKrmGCj6yiNFw5I1rWq8uRWtpElQ== X-Received: by 2002:a5d:58ea:0:b0:32d:819d:ec75 with SMTP id f10-20020a5d58ea000000b0032d819dec75mr2386176wrd.60.1697842440162; Fri, 20 Oct 2023 15:54:00 -0700 (PDT) Received: from localhost (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id b16-20020a5d5510000000b0032d2489a399sm2530010wrv.49.2023.10.20.15.53.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 15:53:59 -0700 (PDT) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Subject: [PATCH] drm/ssd130x: Fix possible uninitialized usage of crtc_state variable Date: Sat, 21 Oct 2023 00:52:57 +0200 Message-ID: <20231020225338.1686974-1-javierm@redhat.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Zimmermann , Javier Martinez Canillas , Maxime Ripard , dri-devel@lists.freedesktop.org, Dan Carpenter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Avoid a possible uninitialized use of the crtc_state variable in function ssd132x_primary_plane_atomic_check() and avoid the following Smatch warn: drivers/gpu/drm/solomon/ssd130x.c:921 ssd132x_primary_plane_atomic_check() error: uninitialized symbol 'crtc_state'. Fixes: fdd591e00a9c ("drm/ssd130x: Add support for the SSD132x OLED controller family") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/dri-devel/7dd6ca45-8263-44fe-a318-2fd9d761425d@moroto.mountain/ Signed-off-by: Javier Martinez Canillas Acked-by: Jocelyn Falempe --- drivers/gpu/drm/solomon/ssd130x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c index 32f0857aec9f..e0174f82e353 100644 --- a/drivers/gpu/drm/solomon/ssd130x.c +++ b/drivers/gpu/drm/solomon/ssd130x.c @@ -910,7 +910,7 @@ static int ssd132x_primary_plane_atomic_check(struct drm_plane *plane, struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane); struct ssd130x_plane_state *ssd130x_state = to_ssd130x_plane_state(plane_state); struct drm_crtc *crtc = plane_state->crtc; - struct drm_crtc_state *crtc_state; + struct drm_crtc_state *crtc_state = NULL; const struct drm_format_info *fi; unsigned int pitch; int ret;