mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev, Akhil P Oommen <akhilpo@oss.qualcomm.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
	linux-kernel@vger.kernel.org,
	Rob Clark <robin.clark@oss.qualcomm.com>
Subject: drivers/gpu/drm/msm/adreno/a3xx_gpu.c:530 a3xx_gpu_init() warn: variable dereferenced before check 'pdev' (see line 525)
Date: Thu, 19 Mar 2026 12:19:09 +0300	[thread overview]
Message-ID: <202603191102.hueYyyPw-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8a30aeb0d1b4e4aaf7f7bae72f20f2ae75385ccb
commit: 491fadb2b818e1d900229a1f8243de6458381306 drm/msm/adreno: Move adreno_gpu_func to catalogue
config: arm64-randconfig-r073-20260319 (https://download.01.org/0day-ci/archive/20260319/202603191102.hueYyyPw-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 4abb927bacf37f18f6359a41639a6d1b3bffffb5)
smatch: v0.5.0-9004-gb810ac53

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202603191102.hueYyyPw-lkp@intel.com/

smatch warnings:
drivers/gpu/drm/msm/adreno/a3xx_gpu.c:530 a3xx_gpu_init() warn: variable dereferenced before check 'pdev' (see line 525)
drivers/gpu/drm/msm/adreno/a2xx_gpu.c:503 a2xx_gpu_init() warn: variable dereferenced before check 'pdev' (see line 500)
drivers/gpu/drm/msm/adreno/a4xx_gpu.c:642 a4xx_gpu_init() warn: variable dereferenced before check 'pdev' (see line 637)

vim +/pdev +530 drivers/gpu/drm/msm/adreno/a3xx_gpu.c

491fadb2b818e1 Akhil P Oommen 2025-11-18  518  static struct msm_gpu *a3xx_gpu_init(struct drm_device *dev)
7198e6b03155f6 Rob Clark      2013-07-19  519  {
7198e6b03155f6 Rob Clark      2013-07-19  520  	struct a3xx_gpu *a3xx_gpu = NULL;
55459968176f13 Rob Clark      2013-12-05  521  	struct adreno_gpu *adreno_gpu;
7198e6b03155f6 Rob Clark      2013-07-19  522  	struct msm_gpu *gpu;
060530f1ea6740 Rob Clark      2014-03-03  523  	struct msm_drm_private *priv = dev->dev_private;
060530f1ea6740 Rob Clark      2014-03-03  524  	struct platform_device *pdev = priv->gpu_pdev;
491fadb2b818e1 Akhil P Oommen 2025-11-18 @525  	struct adreno_platform_config *config = pdev->dev.platform_data;
                                                                                        ^^^^^^
Patch adds a dereference.

5785dd7a8ef0de Akhil P Oommen 2020-10-28  526  	struct icc_path *ocmem_icc_path;
5785dd7a8ef0de Akhil P Oommen 2020-10-28  527  	struct icc_path *icc_path;
7198e6b03155f6 Rob Clark      2013-07-19  528  	int ret;
7198e6b03155f6 Rob Clark      2013-07-19  529  
7198e6b03155f6 Rob Clark      2013-07-19 @530  	if (!pdev) {
                                                     ^^^^
But the old code assumed pdev could be NULL.  Probably the NULL checks
are unnecessary.

6a41da17e87dee Mamta Shukla   2018-10-20  531  		DRM_DEV_ERROR(dev->dev, "no a3xx device\n");
7198e6b03155f6 Rob Clark      2013-07-19  532  		ret = -ENXIO;
7198e6b03155f6 Rob Clark      2013-07-19  533  		goto fail;
7198e6b03155f6 Rob Clark      2013-07-19  534  	}

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


                 reply	other threads:[~2026-03-19  9:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202603191102.hueYyyPw-lkp@intel.com \
    --to=dan.carpenter@linaro.org \
    --cc=akhilpo@oss.qualcomm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@lists.linux.dev \
    --cc=robin.clark@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®