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/firmware/arm_ffa/driver.c:1152:6-15: ERROR: invalid reference to the index variable of the iterator on line 1148
Date: Fri, 30 May 2025 20:42:27 +0800	[thread overview]
Message-ID: <202505302007.D7owsaRu-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Sudeep Holla <sudeep.holla@arm.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f66bc387efbee59978e076ce9bf123ac353b389c
commit: be61da938576671c664382a059f961d7b4b2fc41 firmware: arm_ffa: Allow multiple UUIDs per partition to register SRI callback
date:   3 months ago
:::::: branch date: 7 hours ago
:::::: commit date: 3 months ago
config: arm64-randconfig-r064-20250530 (https://download.01.org/0day-ci/archive/20250530/202505302007.D7owsaRu-lkp@intel.com/config)
compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)

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: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202505302007.D7owsaRu-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> drivers/firmware/arm_ffa/driver.c:1152:6-15: ERROR: invalid reference to the index variable of the iterator on line 1148

vim +1152 drivers/firmware/arm_ffa/driver.c

e0573444edbf4ee Sudeep Holla     2023-10-05  1130  
be61da938576671 Sudeep Holla     2025-02-17  1131  static int
be61da938576671 Sudeep Holla     2025-02-17  1132  ffa_sched_recv_cb_update(struct ffa_device *dev, ffa_sched_recv_cb callback,
0184450b8b1e773 Sudeep Holla     2023-10-05  1133  			 void *cb_data, bool is_registration)
0184450b8b1e773 Sudeep Holla     2023-10-05  1134  {
be61da938576671 Sudeep Holla     2025-02-17  1135  	struct ffa_dev_part_info *partition = NULL, *tmp;
be61da938576671 Sudeep Holla     2025-02-17  1136  	struct list_head *phead;
0184450b8b1e773 Sudeep Holla     2023-10-05  1137  	bool cb_valid;
0184450b8b1e773 Sudeep Holla     2023-10-05  1138  
f4bfcaee34bc952 Sudeep Holla     2023-10-24  1139  	if (ffa_notifications_disabled())
f4bfcaee34bc952 Sudeep Holla     2023-10-24  1140  		return -EOPNOTSUPP;
f4bfcaee34bc952 Sudeep Holla     2023-10-24  1141  
be61da938576671 Sudeep Holla     2025-02-17  1142  	phead = xa_load(&drv_info->partition_info, dev->vm_id);
be61da938576671 Sudeep Holla     2025-02-17  1143  	if (!phead) {
be61da938576671 Sudeep Holla     2025-02-17  1144  		pr_err("%s: Invalid partition ID 0x%x\n", __func__, dev->vm_id);
be61da938576671 Sudeep Holla     2025-02-17  1145  		return -EINVAL;
be61da938576671 Sudeep Holla     2025-02-17  1146  	}
be61da938576671 Sudeep Holla     2025-02-17  1147  
be61da938576671 Sudeep Holla     2025-02-17 @1148  	list_for_each_entry_safe(partition, tmp, phead, node)
be61da938576671 Sudeep Holla     2025-02-17  1149  		if (partition->dev == dev)
be61da938576671 Sudeep Holla     2025-02-17  1150  			break;
be61da938576671 Sudeep Holla     2025-02-17  1151  
c00d9738fd5fce1 Cristian Marussi 2024-01-08 @1152  	if (!partition) {
be61da938576671 Sudeep Holla     2025-02-17  1153  		pr_err("%s: No such partition ID 0x%x\n", __func__, dev->vm_id);
c00d9738fd5fce1 Cristian Marussi 2024-01-08  1154  		return -EINVAL;
c00d9738fd5fce1 Cristian Marussi 2024-01-08  1155  	}
c00d9738fd5fce1 Cristian Marussi 2024-01-08  1156  
0184450b8b1e773 Sudeep Holla     2023-10-05  1157  	write_lock(&partition->rw_lock);
0184450b8b1e773 Sudeep Holla     2023-10-05  1158  
0184450b8b1e773 Sudeep Holla     2023-10-05  1159  	cb_valid = !!partition->callback;
0184450b8b1e773 Sudeep Holla     2023-10-05  1160  	if (!(is_registration ^ cb_valid)) {
0184450b8b1e773 Sudeep Holla     2023-10-05  1161  		write_unlock(&partition->rw_lock);
0184450b8b1e773 Sudeep Holla     2023-10-05  1162  		return -EINVAL;
0184450b8b1e773 Sudeep Holla     2023-10-05  1163  	}
0184450b8b1e773 Sudeep Holla     2023-10-05  1164  
0184450b8b1e773 Sudeep Holla     2023-10-05  1165  	partition->callback = callback;
0184450b8b1e773 Sudeep Holla     2023-10-05  1166  	partition->cb_data = cb_data;
0184450b8b1e773 Sudeep Holla     2023-10-05  1167  
0184450b8b1e773 Sudeep Holla     2023-10-05  1168  	write_unlock(&partition->rw_lock);
0184450b8b1e773 Sudeep Holla     2023-10-05  1169  	return 0;
0184450b8b1e773 Sudeep Holla     2023-10-05  1170  }
0184450b8b1e773 Sudeep Holla     2023-10-05  1171  

:::::: The code at line 1152 was first introduced by commit
:::::: c00d9738fd5fce15dc5494d05b7599dce23e8146 firmware: arm_ffa: Check xa_load() return value

:::::: TO: Cristian Marussi <cristian.marussi@arm.com>
:::::: CC: Sudeep Holla <sudeep.holla@arm.com>

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

             reply	other threads:[~2025-05-30 12:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-30 12:42 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-12-13 14:10 drivers/firmware/arm_ffa/driver.c:1152:6-15: ERROR: invalid reference to the index variable of the iterator on line 1148 kernel test robot
2026-01-22  7:54 kernel test robot

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=202505302007.D7owsaRu-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.