All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Julia Lawall <julia.lawall@inria.fr>
Subject: drivers/gpu/drm/xe/xe_guc_ct.c:117:11-20: ERROR: __cleanup(kfree) will cause an invalid free: the stack address of the annotated variable will be passed to kfree; declare the variable using __free(kfree) to cause the pointee to be freed
Date: Sat, 07 Nov 2026 15:11:12 +0100	[thread overview]
Message-ID: <202611071504.Sfm2Y3U5-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
CC: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d48723711bae9b8cdc56719c448ba42fef28cbee
commit: ea944d57eac746f9bd9056134751708c48084207 drm/xe/guc_ct: Cleanup ifdef'ry
date:   12 months ago
:::::: branch date: 17 hours ago
:::::: commit date: 12 months ago
config: i386-randconfig-2104-20261107 (https://download.01.org/0day-ci/archive/20261107/202611071504.Sfm2Y3U5-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.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
| Fixes: ea944d57eac7 ("drm/xe/guc_ct: Cleanup ifdef'ry")
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202611071504.Sfm2Y3U5-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/xe/xe_guc_ct.c:117:11-20: ERROR: __cleanup(kfree) will cause an invalid free: the stack address of the annotated variable will be passed to kfree; declare the variable using __free(kfree) to cause the pointee to be freed

vim +117 drivers/gpu/drm/xe/xe_guc_ct.c

ea944d57eac746f Lucas De Marchi 2025-11-19  112  
ea944d57eac746f Lucas De Marchi 2025-11-19  113  static void fast_req_dump(struct xe_guc_ct *ct, u16 fence, unsigned int slot)
ea944d57eac746f Lucas De Marchi 2025-11-19  114  {
ea944d57eac746f Lucas De Marchi 2025-11-19  115  	struct xe_gt *gt = ct_to_gt(ct);
ea944d57eac746f Lucas De Marchi 2025-11-19  116  #if IS_ENABLED(CONFIG_DRM_XE_DEBUG_GUC)
ea944d57eac746f Lucas De Marchi 2025-11-19 @117  	char *buf __cleanup(kfree) = kmalloc(SZ_4K, GFP_NOWAIT);
ea944d57eac746f Lucas De Marchi 2025-11-19  118  
ea944d57eac746f Lucas De Marchi 2025-11-19  119  	if (buf && stack_depot_snprint(ct->fast_req[slot].stack, buf, SZ_4K, 0))
ea944d57eac746f Lucas De Marchi 2025-11-19  120  		xe_gt_err(gt, "Fence 0x%x was used by action %#04x sent at:\n%s\n",
ea944d57eac746f Lucas De Marchi 2025-11-19  121  			  fence, ct->fast_req[slot].action, buf);
ea944d57eac746f Lucas De Marchi 2025-11-19  122  	else
ea944d57eac746f Lucas De Marchi 2025-11-19  123  		xe_gt_err(gt, "Fence 0x%x was used by action %#04x [failed to retrieve stack]\n",
ea944d57eac746f Lucas De Marchi 2025-11-19  124  			  fence, ct->fast_req[slot].action);
ea944d57eac746f Lucas De Marchi 2025-11-19  125  #else
ea944d57eac746f Lucas De Marchi 2025-11-19  126  	xe_gt_err(gt, "Fence 0x%x was used by action %#04x\n",
ea944d57eac746f Lucas De Marchi 2025-11-19  127  		  fence, ct->fast_req[slot].action);
ea944d57eac746f Lucas De Marchi 2025-11-19  128  #endif
ea944d57eac746f Lucas De Marchi 2025-11-19  129  }
ea944d57eac746f Lucas De Marchi 2025-11-19  130  

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

                 reply	other threads:[~2026-11-07 14:11 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=202611071504.Sfm2Y3U5-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=julia.lawall@inria.fr \
    --cc=oe-kbuild@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.