From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev,
Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>,
Yannick Fertre <yannick.fertre@foss.st.com>,
Philippe Cornu <philippe.cornu@foss.st.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
dri-devel@lists.freedesktop.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/stm: ltdc: unify log system
Date: Mon, 25 Aug 2025 10:35:17 +0300 [thread overview]
Message-ID: <202508250637.nLxtkS26-lkp@intel.com> (raw)
In-Reply-To: <20250821130356.883553-1-raphael.gallais-pou@foss.st.com>
Hi Raphael,
kernel test robot noticed the following build warnings:
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Raphael-Gallais-Pou/drm-stm-ltdc-unify-log-system/20250821-210930
base: https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next
patch link: https://lore.kernel.org/r/20250821130356.883553-1-raphael.gallais-pou%40foss.st.com
patch subject: [PATCH] drm/stm: ltdc: unify log system
config: arm-randconfig-r072-20250824 (https://download.01.org/0day-ci/archive/20250825/202508250637.nLxtkS26-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 8.5.0
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/202508250637.nLxtkS26-lkp@intel.com/
New smatch warnings:
drivers/gpu/drm/stm/ltdc.c:1150 ltdc_crtc_set_crc_source() warn: variable dereferenced before check 'crtc' (see line 1148)
drivers/gpu/drm/stm/ltdc.c:1174 ltdc_crtc_verify_crc_source() warn: variable dereferenced before check 'crtc' (see line 1172)
vim +/crtc +1150 drivers/gpu/drm/stm/ltdc.c
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1143 static int ltdc_crtc_set_crc_source(struct drm_crtc *crtc, const char *source)
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1144 {
898a9e3f56db98 Raphael Gallais-Pou 2023-05-15 1145 struct ltdc_device *ldev;
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1146 int ret;
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1147
fa2b2390600532 Raphael Gallais-Pou 2025-08-21 @1148 drm_dbg_driver(crtc->dev, "\n");
^^^^^^^^^
Dereference. A lot of the time people would suggest to delete these
types of printks and use ftrace instead.
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1149
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 @1150 if (!crtc)
^^^^^
Checked too late.
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1151 return -ENODEV;
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1152
898a9e3f56db98 Raphael Gallais-Pou 2023-05-15 1153 ldev = crtc_to_ltdc(crtc);
898a9e3f56db98 Raphael Gallais-Pou 2023-05-15 1154
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1155 if (source && strcmp(source, "auto") == 0) {
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1156 ldev->crc_active = true;
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1157 ret = regmap_set_bits(ldev->regmap, LTDC_GCR, GCR_CRCEN);
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1158 } else if (!source) {
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1159 ldev->crc_active = false;
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1160 ret = regmap_clear_bits(ldev->regmap, LTDC_GCR, GCR_CRCEN);
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1161 } else {
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1162 ret = -EINVAL;
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1163 }
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1164
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1165 ldev->crc_skip_count = 0;
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1166 return ret;
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1167 }
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1168
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1169 static int ltdc_crtc_verify_crc_source(struct drm_crtc *crtc,
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1170 const char *source, size_t *values_cnt)
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1171 {
fa2b2390600532 Raphael Gallais-Pou 2025-08-21 @1172 drm_dbg_driver(crtc->dev, "\n");
^^^^^^^^
Dereference
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1173
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 @1174 if (!crtc)
^^^^^
Too late.
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1175 return -ENODEV;
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1176
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1177 if (source && strcmp(source, "auto") != 0) {
fa2b2390600532 Raphael Gallais-Pou 2025-08-21 1178 drm_dbg_driver(crtc->dev, "Unknown CRC source %s for %s\n",
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1179 source, crtc->name);
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1180 return -EINVAL;
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1181 }
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1182
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1183 *values_cnt = 1;
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1184 return 0;
79b44684a14e36 Raphael Gallais-Pou 2022-02-11 1185 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2025-08-25 7:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-21 13:03 Raphael Gallais-Pou
2025-08-22 12:25 ` Yannick FERTRE
2025-08-25 7:35 ` Dan Carpenter [this message]
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=202508250637.nLxtkS26-lkp@intel.com \
--to=dan.carpenter@linaro.org \
--cc=airlied@gmail.com \
--cc=alexandre.torgue@foss.st.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=lkp@intel.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=mripard@kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=philippe.cornu@foss.st.com \
--cc=raphael.gallais-pou@foss.st.com \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=yannick.fertre@foss.st.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®