[linux-next:master 9025/9312] drivers/soc/qcom/pdr_interface.c:316:2: warning: variable 'found' is used uninitialized whenever 'for' loop exits because its condition is false

0 zobrazení
Preskočiť na prvú neprečítanú správu

kbuild test robot

neprečítané,
16. 3. 2020, 18:28:1916. 3. 2020
komu: Bjorn Andersson, kbuil...@lists.01.org, clang-bu...@googlegroups.com
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 8548fd2f20ed19b0e8c0585b71fdfde1ae00ae3c
commit: d538b863da31a4070276cebcd490a8bb45c4a45a [9025/9312] Merge remote-tracking branch 'qcom/for-next'
config: arm64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (git://gitmirror/llvm_project 14a1b80e044aac1947c891525cf30521be0a79b7)
reproduce:
# FIXME the reproduce steps for clang is not ready yet

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <l...@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/soc/qcom/pdr_interface.c:316:2: warning: variable 'found' is used uninitialized whenever 'for' loop exits because its condition is false [-Wsometimes-uninitialized]
list_for_each_entry(pds, &pdr->lookups, node) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/list.h:602:7: note: expanded from macro 'list_for_each_entry'
&pos->member != (head); \
^~~~~~~~~~~~~~~~~~~~~~
drivers/soc/qcom/pdr_interface.c:325:7: note: uninitialized use occurs here
if (!found)
^~~~~
drivers/soc/qcom/pdr_interface.c:316:2: note: remove the condition if it is always true
list_for_each_entry(pds, &pdr->lookups, node) {
^
include/linux/list.h:602:7: note: expanded from macro 'list_for_each_entry'
&pos->member != (head); \
^
drivers/soc/qcom/pdr_interface.c:309:12: note: initialize the variable 'found' to silence this warning
bool found;
^
= 0
1 warning generated.

vim +316 drivers/soc/qcom/pdr_interface.c

fbe639b44a82755 Sibi Sankar 2020-03-12 299
fbe639b44a82755 Sibi Sankar 2020-03-12 300 static void pdr_indication_cb(struct qmi_handle *qmi,
fbe639b44a82755 Sibi Sankar 2020-03-12 301 struct sockaddr_qrtr *sq,
fbe639b44a82755 Sibi Sankar 2020-03-12 302 struct qmi_txn *txn, const void *data)
fbe639b44a82755 Sibi Sankar 2020-03-12 303 {
fbe639b44a82755 Sibi Sankar 2020-03-12 304 struct pdr_handle *pdr = container_of(qmi, struct pdr_handle,
fbe639b44a82755 Sibi Sankar 2020-03-12 305 notifier_hdl);
fbe639b44a82755 Sibi Sankar 2020-03-12 306 const struct servreg_state_updated_ind *ind_msg = data;
fbe639b44a82755 Sibi Sankar 2020-03-12 307 struct pdr_list_node *ind;
fbe639b44a82755 Sibi Sankar 2020-03-12 308 struct pdr_service *pds;
fbe639b44a82755 Sibi Sankar 2020-03-12 309 bool found;
fbe639b44a82755 Sibi Sankar 2020-03-12 310
fbe639b44a82755 Sibi Sankar 2020-03-12 311 if (!ind_msg || !ind_msg->service_path[0] ||
fbe639b44a82755 Sibi Sankar 2020-03-12 312 strlen(ind_msg->service_path) > SERVREG_NAME_LENGTH)
fbe639b44a82755 Sibi Sankar 2020-03-12 313 return;
fbe639b44a82755 Sibi Sankar 2020-03-12 314
fbe639b44a82755 Sibi Sankar 2020-03-12 315 mutex_lock(&pdr->list_lock);
fbe639b44a82755 Sibi Sankar 2020-03-12 @316 list_for_each_entry(pds, &pdr->lookups, node) {
fbe639b44a82755 Sibi Sankar 2020-03-12 317 if (strcmp(pds->service_path, ind_msg->service_path))
fbe639b44a82755 Sibi Sankar 2020-03-12 318 continue;
fbe639b44a82755 Sibi Sankar 2020-03-12 319
fbe639b44a82755 Sibi Sankar 2020-03-12 320 found = true;
fbe639b44a82755 Sibi Sankar 2020-03-12 321 break;
fbe639b44a82755 Sibi Sankar 2020-03-12 322 }
fbe639b44a82755 Sibi Sankar 2020-03-12 323 mutex_unlock(&pdr->list_lock);
fbe639b44a82755 Sibi Sankar 2020-03-12 324
fbe639b44a82755 Sibi Sankar 2020-03-12 325 if (!found)
fbe639b44a82755 Sibi Sankar 2020-03-12 326 return;
fbe639b44a82755 Sibi Sankar 2020-03-12 327
fbe639b44a82755 Sibi Sankar 2020-03-12 328 pr_info("PDR: Indication received from %s, state: 0x%x, trans-id: %d\n",
fbe639b44a82755 Sibi Sankar 2020-03-12 329 ind_msg->service_path, ind_msg->curr_state,
fbe639b44a82755 Sibi Sankar 2020-03-12 330 ind_msg->transaction_id);
fbe639b44a82755 Sibi Sankar 2020-03-12 331
fbe639b44a82755 Sibi Sankar 2020-03-12 332 ind = kzalloc(sizeof(*ind), GFP_KERNEL);
fbe639b44a82755 Sibi Sankar 2020-03-12 333 if (!ind)
fbe639b44a82755 Sibi Sankar 2020-03-12 334 return;
fbe639b44a82755 Sibi Sankar 2020-03-12 335
fbe639b44a82755 Sibi Sankar 2020-03-12 336 ind->transaction_id = ind_msg->transaction_id;
fbe639b44a82755 Sibi Sankar 2020-03-12 337 ind->curr_state = ind_msg->curr_state;
fbe639b44a82755 Sibi Sankar 2020-03-12 338 ind->pds = pds;
fbe639b44a82755 Sibi Sankar 2020-03-12 339
fbe639b44a82755 Sibi Sankar 2020-03-12 340 mutex_lock(&pdr->list_lock);
fbe639b44a82755 Sibi Sankar 2020-03-12 341 list_add_tail(&ind->node, &pdr->indack_list);
fbe639b44a82755 Sibi Sankar 2020-03-12 342 mutex_unlock(&pdr->list_lock);
fbe639b44a82755 Sibi Sankar 2020-03-12 343
fbe639b44a82755 Sibi Sankar 2020-03-12 344 queue_work(pdr->indack_wq, &pdr->indack_work);
fbe639b44a82755 Sibi Sankar 2020-03-12 345 }
fbe639b44a82755 Sibi Sankar 2020-03-12 346

:::::: The code at line 316 was first introduced by commit
:::::: fbe639b44a82755d639df1c5d147c93f02ac5a0f soc: qcom: Introduce Protection Domain Restart helpers

:::::: TO: Sibi Sankar <si...@codeaurora.org>
:::::: CC: Bjorn Andersson <bjorn.a...@linaro.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuil...@lists.01.org
.config.gz

Nick Desaulniers

neprečítané,
16. 3. 2020, 18:31:3016. 3. 2020
komu: kbuild test robot, Bjorn Andersson, kbuil...@lists.01.org, clang-built-linux
A patch has just been submitted for this, please ignore the report:
https://github.com/ClangBuiltLinux/linux/issues/933
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-li...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/202003170630.NGJUYTfo%25lkp%40intel.com.



--
Thanks,
~Nick Desaulniers
Odpovedať všetkým
Odpovedať autorovi
Poslať ďalej
0 nových správ