From mboxrd@z Thu Jan 1 00:00:00 1970 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 593E9E63F37 for ; Mon, 16 Feb 2026 08:38:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 72B4210E17A; Mon, 16 Feb 2026 08:38:43 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ammUolMM"; dkim-atps=neutral Received: from mail-yx1-f50.google.com (mail-yx1-f50.google.com [74.125.224.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id 927F710E11E for ; Mon, 16 Feb 2026 04:04:57 +0000 (UTC) Received: by mail-yx1-f50.google.com with SMTP id 956f58d0204a3-64ae5f0777dso2557012d50.3 for ; Sun, 15 Feb 2026 20:04:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771214696; x=1771819496; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=tRRuxIXhMKonaU99F20lodjybZ7fyhXBnJ+HNCXqEL4=; b=ammUolMMEwLHhTcQ0PlRpIAGQbnZGf6eohpLIVnA8KcgSyzNYumZT/tT2xFoFwvF+Q q0IBoANa1ZMhcK8t8bi/hfGG7H5CNkwlBah0jxZ8jW417/UbjLHRC0rTMNgXfFNn5Qfv tx2kKSVxEjYMiiznR0prH0oh8pJC581lHwCZqlHzsBfas2G2EeMHPkgvAxq08gG0BkwY S1z08NR68pJdZUids+gtIRlVeYnTbcbHgeu7D81QzsARUUmz2B/t0ZLqLNlpBReM00y0 lkpmgr52MUtILVPH8QhPrEI6y+wz/w5uSniP72y7UfD21FI7hgUKTaoGsTTV+NrZr7N9 1FFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771214696; x=1771819496; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=tRRuxIXhMKonaU99F20lodjybZ7fyhXBnJ+HNCXqEL4=; b=XkfPeuZKDaCol1uMjTOGTq6eqYeyjr7Q2GXrnt56jJKn+sqFqn8saQcNegHt6vWQna 1pumTS9W0x0w1MeNLWmyNT4KInWts+1xCiMD8Xns21Tuimsme/FY4WN0QjGhWF+G392h EtIBV6VPrJKN4JH2I4SYJDdgmsEyoDNkHy6IDEGf0KNE+wgXed0znUDGuUIjbhyhBNvr pUjGRcYaj/TlpcP1+K1vViEaf4JBZaPh3WvK17uqLLXKzST7CzyoJuWfWIdy/pvBCJmc DMoR+e97QBX2Lx/TU9k8kh8eq5VNYt9yQcJrHx9gYS6ZHVe3zYViadZdNE4FiApz+R9M +XnA== X-Forwarded-Encrypted: i=1; AJvYcCVQ6HRsMASc9Gd3071fZ/+K8UDorW9PNsZMG4+5wwku4gGZakVNAcOpZGSc2EHOQRIJqs52UVOFWDg=@lists.freedesktop.org X-Gm-Message-State: AOJu0YzeWAhM+F6DOVNczT7/WaONTaktb0kVnApMENYXCl985HSRfLKD HEcjuM0YqDJJywSyxv4fE7SISQVQOXlk/lYE38RDjS8SGZGd5A2UwwDE X-Gm-Gg: AZuq6aJ6nTUetujKsDN2KNiZyJlj84+JLmSD2FdOy2mTOw6DJRM7pTUB7Dw0m+BYXii guyeiirOX3icTt43UK6n5VgJC5z3RiYiQJ6IDp5Xg6w3jOEsavv9GatK7NYfMa3rUzUYy9NmmTg gUt3/hf9Psc+qKmUETdl+tWo+C2byy2P/HN9GCKwffX5QiRMMTSHq1pAwcU/Z1L1QLnCd25mq1j Yw0z70Dl2Mtb6z7nXaEViELi/QhXrV68H14g1hf9nHGS3nGTRCidfFvcrlh0ZGwr+AFZKHRiiGj h9lLInG/FT5GV30PM97t2p+Lg08Z0nY42LF4t3/OukcHRpUNwLl7uBV+pMUQov3S/EUiTOd2ZyO yj3FGfuSqOQKipQbRu3yc2qcpes5QBY3qkXGfposwR5XVT9x269OXCTUcLYYZCR+Yr8DeCAm4ii EKQ2sMTMRrISwQnb8B2/PclJ5ywHAyPLmP1jmrpO/VcA8T3q5rm3+kqEwVqI3CxtLn8AHFTwXYY Y1/jgujL4HQP+lErxd9sWM664mIkHdnQDwNx1Wqd/w= X-Received: by 2002:a05:690c:34c1:b0:794:d887:7257 with SMTP id 00721157ae682-797a0bfadc6mr149673077b3.21.1771214696299; Sun, 15 Feb 2026 20:04:56 -0800 (PST) Received: from tux ([2601:7c0:c37c:4c00:e3a8:26f7:7e08:88e1]) by smtp.gmail.com with ESMTPSA id 00721157ae682-797a5caf0e4sm34101517b3.27.2026.02.15.20.04.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Feb 2026 20:04:56 -0800 (PST) From: Ethan Tidmore To: lanzano.alex@gmail.com Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, lumag@kernel.org, mehdi.djait@bootlin.com, u.kleine-koenig@baylibre.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Ethan Tidmore Subject: [PATCH] drm/tiny: sharp-memory: fix pointer error dereference Date: Sun, 15 Feb 2026 22:04:38 -0600 Message-ID: <20260216040438.43702-1-ethantidmore06@gmail.com> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Mon, 16 Feb 2026 08:38:41 +0000 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The function devm_drm_dev_alloc() returns a pointer error upon failure not NULL. Change null check to pointer error check. Detected by Smatch: drivers/gpu/drm/tiny/sharp-memory.c:549 sharp_memory_probe() error: 'smd' dereferencing possible ERR_PTR() Fixes: b8f9f21716fec ("drm/tiny: Add driver for Sharp Memory LCD") Signed-off-by: Ethan Tidmore --- drivers/gpu/drm/tiny/sharp-memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tiny/sharp-memory.c b/drivers/gpu/drm/tiny/sharp-memory.c index 64272cd0f6e2..cbf69460ebf3 100644 --- a/drivers/gpu/drm/tiny/sharp-memory.c +++ b/drivers/gpu/drm/tiny/sharp-memory.c @@ -541,8 +541,8 @@ static int sharp_memory_probe(struct spi_device *spi) smd = devm_drm_dev_alloc(dev, &sharp_memory_drm_driver, struct sharp_memory_device, drm); - if (!smd) - return -ENOMEM; + if (IS_ERR(smd)) + return PTR_ERR(smd); spi_set_drvdata(spi, smd); -- 2.53.0