Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp271553lqp; Mon, 10 Jun 2024 03:51:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWisC/QGnPnSqIx8G4kIwqjwe2a09jSARZxXhd3opCLhDcBLVAF5MjXR0WlPOcxE7qTI/w8AqebxXqDyRVt5VKJsyH6Ejbx2lMGGzZtrA== X-Google-Smtp-Source: AGHT+IHoVoz2sW9ZmPXRTMtLXu3R5+3G7c/kEX4eOxBGHC3P6cJuKzPib6gZNOGlkVNvcPwnZP80 X-Received: by 2002:a17:902:e552:b0:1f6:8be6:428d with SMTP id d9443c01a7336-1f6d03c295dmr103412635ad.56.1718016680363; Mon, 10 Jun 2024 03:51:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718016680; cv=pass; d=google.com; s=arc-20160816; b=kr8DQmJJQ/TVmABogT9z2ZHFJ0DhwtEUYAxfHrZDFJTlv+LPLQnMQtzewHEqA7UlHN 5lCxgnbdHcneD05YXIYnJ+WArmgKpt9b6wnlIYqzXRm3yfnLKGhiXg6GkTi5ldzmp75D 9m1KRs6UuN+rbhjXEl4J0oFFnvLr+xomG3hogCmxF8zyrRerrtkLL5/V9NsixGOSaowr za3bdDe5tX9eTGEVf6dWi53StKJ4e//wzRCeyiZhQV/a+wIOaa75n6IR3TPAobJjHcsA r/r7pbH/AuHvEBW3w0JiBlayOm9eoMFLJ5Up1HPsS4F7hvsNblgludzDaZvfIuHkJsuh BD1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=pXakxMI2Um+1HzzohGpmKa0TIP5gavEExiiAxnB1onk=; fh=+ivFgT23KJSHj9F534xGHI2FAMnhrIXbiV8geGMMoCw=; b=zEHL+tZXjcqdaxUR6a/i6Z6nEPVt8sk4updWQad1lvi/mM4NzOYFc2QZqPFb2m7L2P riJCn2k6erBDwtq9+mCH0bLz24YAIB2IIs2ovvhpQZL2yS70twiFdJemzRXv2RYjPcvq RIMJqhWOrjQqAuVT0/R7D2RmywsAJ9l5Q8g4tctWK1sCFp3bglxrPZSRiE/PWBPtR8os wqJpeBrBaBjA8eCvvIHaTb/+kGN9n7uNsq57jaDzZ+D01W3Wvcz81rOn8t2MpmQ2f0Ec CmOKhIgYSGAlzLipLySok4auhqBY21+QTIzKIh1v0j5J7nW7xRXi1ZaqIO7BJ862Nuiw cAIQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-208002-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208002-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd81e61asi35309815ad.554.2024.06.10.03.51.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 03:51:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208002-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-208002-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208002-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 16F93B2659D for ; Mon, 10 Jun 2024 10:21:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED60B78C64; Mon, 10 Jun 2024 10:21:23 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 84F8A28EA for ; Mon, 10 Jun 2024 10:21:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718014883; cv=none; b=FfubsA9gsmU+fqxQGcLoXD1DFsFp64CMxHGtUjwKRF851NIaCNfSD9Al+N7GEJ5MWhJf8tvsPu82h6i6N8qoeXjd0FBp8JjDN8O7tdEgGk4wbPAPR5obxVsWT8trQ1p3qXfeMfLO79Lep0lw0XnUNVxUMzAcWh0byAYm4JzL0As= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718014883; c=relaxed/simple; bh=89e8j3AIVoF+lup8Sg4ho+WBC6fyTJidQaEDObyz5Ug=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=MlsDevRxrkwBWkHH5d2QxLZhjPiUvspu7y7/uNqGwgbBFcC2jXz7TNDv1602wv28tUQNn9jG47Z8rxFpCcCzBsRmqcX5aeyYs/VbBBj8WDz2smTTQBnO/3/YqFo+MAR23ZLNvK2xnngeMw7a4MZulqK1rSyIZc0Onm2omw/Incc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 06B9C12FC; Mon, 10 Jun 2024 03:21:45 -0700 (PDT) Received: from e127519.cambridge.arm.com (e127519.arm.com [10.1.32.22]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 455343F73B; Mon, 10 Jun 2024 03:21:18 -0700 (PDT) From: Amjad Ouled-Ameur To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Amjad Ouled-Ameur , Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Smitha T Murthy , Deepak Pandey Subject: [PATCH] drm/komeda: check for error-valued pointer Date: Mon, 10 Jun 2024 11:20:56 +0100 Message-Id: <20240610102056.40406-1-amjad.ouled-ameur@arm.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit komeda_pipeline_get_state() may return an error-valued pointer, thus check the pointer for negative or null value before dereferencing. Signed-off-by: Amjad Ouled-Ameur --- drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c index f3e744172673..f4e76b46ca32 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c @@ -259,7 +259,7 @@ komeda_component_get_avail_scaler(struct komeda_component *c, u32 avail_scalers; pipe_st = komeda_pipeline_get_state(c->pipeline, state); - if (!pipe_st) + if (IS_ERR_OR_NULL(pipe_st)) return NULL; avail_scalers = (pipe_st->active_comps & KOMEDA_PIPELINE_SCALERS) ^ -- 2.25.1