From: kernel test robot <lkp@intel.com>
To: Rob Clark <robin.clark@oss.qualcomm.com>,
dri-devel@lists.freedesktop.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
Rob Clark <robin.clark@oss.qualcomm.com>,
Bart Van Assche <bvanassche@acm.org>,
Dmitry Baryshkov <lumag@kernel.org>,
Abhinav Kumar <abhinav.kumar@linux.dev>,
Jessica Zhang <jesszhan0024@gmail.com>,
Sean Paul <sean@poorly.run>,
Marijn Suijten <marijn.suijten@somainline.org>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Konrad Dybcio <konradybcio@kernel.org>,
Akhil P Oommen <akhilpo@oss.qualcomm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/msm/gem: Add some cleanup.h
Date: Tue, 27 Oct 2026 19:30:27 +0800 [thread overview]
Message-ID: <202610271940.hGm7dpnG-lkp@intel.com> (raw)
In-Reply-To: <20261026213701.22126-1-robin.clark@oss.qualcomm.com>
Hi Rob,
kernel test robot noticed the following build warnings:
[auto build test WARNING on drm/drm-next]
[also build test WARNING on drm-i915/for-linux-next drm-i915/for-linux-next-fixes drm-tip/drm-tip linus/master v7.3 next-20261026]
[cannot apply to drm-misc/drm-misc-next daeinki-drm-exynos/exynos-drm-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Rob-Clark/drm-msm-gem-Add-some-cleanup-h/20261026-143700
base: https://gitlab.freedesktop.org/drm/kernel.git drm-next
patch link: https://lore.kernel.org/r/20261026213701.22126-1-robin.clark%40oss.qualcomm.com
patch subject: [PATCH] drm/msm/gem: Add some cleanup.h
config: x86_64-buildonly-randconfig-1005-20261027 (https://download.01.org/0day-ci/archive/20261027/202610271940.hGm7dpnG-lkp@intel.com/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261027/202610271940.hGm7dpnG-lkp@intel.com/reproduce)
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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610271940.hGm7dpnG-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/msm/msm_drv.c:613:13: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
613 | } else if (copy_to_user(metadata, buf, len)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/msm/msm_drv.c:621:9: note: uninitialized use occurs here
621 | return ret;
| ^~~
drivers/gpu/drm/msm/msm_drv.c:613:9: note: remove the 'if' if its condition is always true
613 | } else if (copy_to_user(metadata, buf, len)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
614 | ret = -EFAULT;
615 | } else {
| ~~~~~~
616 | *metadata_size = len;
| ~~~~~~~~~~~~~~~~~~~~~
617 | }
| ~
drivers/gpu/drm/msm/msm_drv.c:588:9: note: initialize the variable 'ret' to silence this warning
588 | int ret, len;
| ^
| = 0
1 warning generated.
vim +613 drivers/gpu/drm/msm/msm_drv.c
9902cb999e4e91 Rob Clark 2023-11-06 581
9902cb999e4e91 Rob Clark 2023-11-06 582 static int msm_ioctl_gem_info_get_metadata(struct drm_gem_object *obj,
9902cb999e4e91 Rob Clark 2023-11-06 583 __user void *metadata,
9902cb999e4e91 Rob Clark 2023-11-06 584 u32 *metadata_size)
9902cb999e4e91 Rob Clark 2023-11-06 585 {
9902cb999e4e91 Rob Clark 2023-11-06 586 struct msm_gem_object *msm_obj = to_msm_bo(obj);
9902cb999e4e91 Rob Clark 2023-11-06 587 void *buf;
9902cb999e4e91 Rob Clark 2023-11-06 588 int ret, len;
9902cb999e4e91 Rob Clark 2023-11-06 589
9902cb999e4e91 Rob Clark 2023-11-06 590 if (!metadata) {
9902cb999e4e91 Rob Clark 2023-11-06 591 /*
9902cb999e4e91 Rob Clark 2023-11-06 592 * Querying the size is inherently racey, but
9902cb999e4e91 Rob Clark 2023-11-06 593 * EXT_external_objects expects the app to confirm
9902cb999e4e91 Rob Clark 2023-11-06 594 * via device and driver UUIDs that the exporter and
9902cb999e4e91 Rob Clark 2023-11-06 595 * importer versions match. All we can do from the
9902cb999e4e91 Rob Clark 2023-11-06 596 * kernel side is check the length under obj lock
9902cb999e4e91 Rob Clark 2023-11-06 597 * when userspace tries to retrieve the metadata
9902cb999e4e91 Rob Clark 2023-11-06 598 */
9902cb999e4e91 Rob Clark 2023-11-06 599 *metadata_size = msm_obj->metadata_size;
9902cb999e4e91 Rob Clark 2023-11-06 600 return 0;
9902cb999e4e91 Rob Clark 2023-11-06 601 }
9902cb999e4e91 Rob Clark 2023-11-06 602
fec06716d04d17 Rob Clark 2026-10-26 603 scoped_cond_guard (gem_lock_intr, return -EINTR, obj) {
fec06716d04d17 Rob Clark 2026-10-26 604 /* Avoid copy_to_user() under gem obj lock by making a copy: */
9902cb999e4e91 Rob Clark 2023-11-06 605 len = msm_obj->metadata_size;
9902cb999e4e91 Rob Clark 2023-11-06 606 buf = kmemdup(msm_obj->metadata, len, GFP_KERNEL);
fec06716d04d17 Rob Clark 2026-10-26 607 if (!buf)
47cbfe2608314b Yasuaki Torimaru 2026-03-25 608 return -ENOMEM;
47cbfe2608314b Yasuaki Torimaru 2026-03-25 609 }
47cbfe2608314b Yasuaki Torimaru 2026-03-25 610
9902cb999e4e91 Rob Clark 2023-11-06 611 if (*metadata_size < len) {
9902cb999e4e91 Rob Clark 2023-11-06 612 ret = -ETOOSMALL;
9902cb999e4e91 Rob Clark 2023-11-06 @613 } else if (copy_to_user(metadata, buf, len)) {
9902cb999e4e91 Rob Clark 2023-11-06 614 ret = -EFAULT;
9902cb999e4e91 Rob Clark 2023-11-06 615 } else {
9902cb999e4e91 Rob Clark 2023-11-06 616 *metadata_size = len;
9902cb999e4e91 Rob Clark 2023-11-06 617 }
9902cb999e4e91 Rob Clark 2023-11-06 618
9902cb999e4e91 Rob Clark 2023-11-06 619 kfree(buf);
9902cb999e4e91 Rob Clark 2023-11-06 620
47cbfe2608314b Yasuaki Torimaru 2026-03-25 621 return ret;
9902cb999e4e91 Rob Clark 2023-11-06 622 }
9902cb999e4e91 Rob Clark 2023-11-06 623
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2026-10-27 11:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 21:37 Rob Clark
2026-10-26 23:04 ` Bart Van Assche
2026-10-27 11:30 ` kernel test robot [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=202610271940.hGm7dpnG-lkp@intel.com \
--to=lkp@intel.com \
--cc=abhinav.kumar@linux.dev \
--cc=airlied@gmail.com \
--cc=akhilpo@oss.qualcomm.com \
--cc=bvanassche@acm.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jesszhan0024@gmail.com \
--cc=konradybcio@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=lumag@kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=robin.clark@oss.qualcomm.com \
--cc=sean@poorly.run \
--cc=simona@ffwll.ch \
/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®