Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1210589lqe; Mon, 8 Apr 2024 01:59:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvcWdTyWFOYDJffrZYtDTt5UwEHcy4sHXD7+b+KGSX3UtOdEfkrhFgjWGm7sPSTdKqEDAuptDXoJnFzr0AJZ5aSjy1wv79tpAYoWgMMg== X-Google-Smtp-Source: AGHT+IHK4u5feeKLXAeFmHT6uQexbdTDlFMlAWTwoi4Ut9bGulVkb4tzZDlszBn1cyj9yELGvsF4 X-Received: by 2002:a05:6512:224d:b0:516:d16e:9059 with SMTP id i13-20020a056512224d00b00516d16e9059mr6311707lfu.42.1712566785480; Mon, 08 Apr 2024 01:59:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712566785; cv=pass; d=google.com; s=arc-20160816; b=k6KSC/1n6DeqNnhEtR1A3hzwn8Gf26tU9IqPC7ZwRnin4ptnc8k/nZbjqI5VF65S7m R3rGvro6sz/8Nbe/RdE+lMi3hqNE1xelDZM8DxLRPFYRv5llYBBS1WFdJOYrTmvxf5pO w/NEfGHtIO9S7WlOetVRwKHalxDhP3jb+XJPGORhCtCVYYkpiHY+yGd9R6uWxSPqTH2E jdOQzRfdqvx84sel3ZUKfTs5tBRQ0ElPUMbZqQcrLIUZfsUhZ8BOEFXXhmzTRTWQ1Bf4 v372MuEqzqrOgSGjLieN3AbkZHfrwla/TPcbxADTTUCzzhZ2ODKPv7YMVuCH1E6T5qPQ /7gQ== 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:dkim-signature; bh=tVaZQ82kV0U3VdjNP3qButkhjLghxD+YcZT09STBU0k=; fh=h5YWg/i9S6y+ntulfk2YtZu6wkh8FCcC5Sq+AsJojKw=; b=V7S7B0I0vLhXS61R7wDzWpzgrn84hBLQtBDxDoiK12MGO78QWuvdpUdde7Y8ekipxZ 8LY9p4IUTfdQIBD6MaYC0GDZLlXyLB/wTMlQ6bI0Pffgbgi2Pzdw95hfnlljWlZ2recz BVGVXmQpFVVz4cc6LwkJAzgBzhfUaAJ1xOIoz0BDVE8uWX9IynrAmNhNYcDUlFpEa3Qz 3/ffruw09pQ5WkketX+0GsSvf2Ibxrzs6ytS5K2aEXVNSp6s0TOEkp4lLEsfJKrhC1Mi BdtlV+i+w6uu9tkcikjSdHy90YjE+v1zS0D8bXZ5k1P7JnNIQTV0dXzPaF9vRyYspg4o oE3g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@t-argos.ru header.s=mail header.b="EWR6+B0/"; arc=pass (i=1 spf=pass spfdomain=t-argos.ru dkim=pass dkdomain=t-argos.ru dmarc=pass fromdomain=t-argos.ru); spf=pass (google.com: domain of linux-kernel+bounces-135092-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135092-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=t-argos.ru Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id d25-20020a50cd59000000b0056e315611b1si3341406edj.135.2024.04.08.01.59.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 01:59:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-135092-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@t-argos.ru header.s=mail header.b="EWR6+B0/"; arc=pass (i=1 spf=pass spfdomain=t-argos.ru dkim=pass dkdomain=t-argos.ru dmarc=pass fromdomain=t-argos.ru); spf=pass (google.com: domain of linux-kernel+bounces-135092-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135092-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=t-argos.ru 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 974151F210C9 for ; Mon, 8 Apr 2024 08:57:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 69FC23C472; Mon, 8 Apr 2024 08:57:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=t-argos.ru header.i=@t-argos.ru header.b="EWR6+B0/" Received: from mx1.t-argos.ru (mx1.t-argos.ru [109.73.34.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B0113C6AC; Mon, 8 Apr 2024 08:57:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=109.73.34.58 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712566662; cv=none; b=ZZv9SvqbZ2Ve6QBGNlMECeR7U+tGqfBKqa76gmJ2zG9ixgkNbNYPpCf9ZdyfOzlrz2InKbXSFbpn5FA8q6sRsHAzypNpiMGN7ju1KMqBXa86RS+4Y+xs5qr/BvrxSVDPzxE8CJ+ymdvzftb7jacwjc9l2AOdjx9rjJ8f62XBqDc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712566662; c=relaxed/simple; bh=71cgcbD3LCizJbaId/qtf0bxqGyZFhg/a+lnSwLkGbw=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ddRGAlHgExwKy+6nES71wZSrVHHodKl6pXVVv9r6SP1xZJaaXYkA+Y35i29vkudpKHvW0DqUf5DQ/1uHI/k06eQIP5G7qO0JXsrCR3Zi/dfIeAUjAqX6wpkbTLHDfjHsVVDV53IDdlneTk+buUn39Lf03xYTQpgnd86mF7rSlVg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=t-argos.ru; spf=pass smtp.mailfrom=t-argos.ru; dkim=pass (2048-bit key) header.d=t-argos.ru header.i=@t-argos.ru header.b=EWR6+B0/; arc=none smtp.client-ip=109.73.34.58 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=t-argos.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=t-argos.ru Received: from mx1.t-argos.ru (localhost [127.0.0.1]) by mx1.t-argos.ru (Postfix) with ESMTP id 0270A100003; Mon, 8 Apr 2024 11:57:14 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=t-argos.ru; s=mail; t=1712566634; bh=tVaZQ82kV0U3VdjNP3qButkhjLghxD+YcZT09STBU0k=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=EWR6+B0/gNf41mL3w6lZmTV9X69uZetXhu7XTDGpVjECqaMntRrs8I03xbrIeGDvb xSR6EPy6HI9obNTSe2zvlXDKzikO5zq+Rm+3ek64f257mnNv4jh+1g9xIvnChEhU+Q fqUyVpBBwyk3NS+flimzDNcWZ0SrLr72HsxJ1n/2zS73uAbed1AzwMnLYY4Wa5Sc6H mkk7MaBQGoZxXYQMDam/uSM1zDLFJdbBAgAtD/eLCQB5Agiv4bgIsWHfclheA+BBO/ /y4lKFaOd7T03nohLLQB4f5CCb0vOX7lsbnvIY5Glh3rApTXFplEwFa+ylZy+QSGyV Uxy26W+/Hm4jA== Received: from mx1.t-argos.ru.ru (ta-mail-02.ta.t-argos.ru [172.17.13.212]) by mx1.t-argos.ru (Postfix) with ESMTP; Mon, 8 Apr 2024 11:55:52 +0300 (MSK) Received: from localhost.localdomain (172.17.215.6) by ta-mail-02 (172.17.13.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Mon, 8 Apr 2024 11:55:32 +0300 From: Aleksandr Mishin To: Dmitry Baryshkov CC: Aleksandr Mishin , Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Neil Armstrong , Stephen Boyd , , , , , Subject: [PATCH] drm/msm/dpu: Add callback function pointer check before its call Date: Mon, 8 Apr 2024 11:55:23 +0300 Message-ID: <20240408085523.12231-1-amishin@t-argos.ru> X-Mailer: git-send-email 2.30.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: ta-mail-02.ta.t-argos.ru (172.17.13.212) To ta-mail-02 (172.17.13.212) X-KSMG-Rule-ID: 1 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 184614 [Apr 08 2024] X-KSMG-AntiSpam-Version: 6.1.0.4 X-KSMG-AntiSpam-Envelope-From: amishin@t-argos.ru X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 15 0.3.15 adb41f89e2951eb37b279104a7abb8e79494a5e7, {Tracking_from_domain_doesnt_match_to}, d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;mx1.t-argos.ru.ru:7.1.1;127.0.0.199:7.1.2;t-argos.ru:7.1.1, FromAlignment: s X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean, bases: 2024/04/08 07:15:00 X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2024/04/08 06:53:00 #24704467 X-KSMG-AntiVirus-Status: Clean, skipped In dpu_core_irq_callback_handler() callback function pointer is compared to NULL, but then callback function is unconditionally called by this pointer. Fix this bug by adding conditional return. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: c929ac60b3ed ("drm/msm/dpu: allow just single IRQ callback") Signed-off-by: Aleksandr Mishin --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c index 946dd0135dff..03a16fbd4c99 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c @@ -223,9 +223,11 @@ static void dpu_core_irq_callback_handler(struct dpu_kms *dpu_kms, unsigned int VERB("IRQ=[%d, %d]\n", DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx)); - if (!irq_entry->cb) + if (!irq_entry->cb) { DRM_ERROR("no registered cb, IRQ=[%d, %d]\n", DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx)); + return; + } atomic_inc(&irq_entry->count); -- 2.30.2