CC: [email protected] TO: Li Wei <[email protected]> CC: "Pan, Kris" <[email protected]> CC: Chen Meng J <[email protected]> CC: Meng Wei <[email protected]>
tree: https://github.com/intel/linux-intel-lts.git 5.10/preempt-rt head: 92cafac7cc9c1af94b9b5b61e35fbbd39d4f5854 commit: 91c71f14b406b0fe0f72f7e75e6a85e344b1927a [10964/17820] media: v4l2-mc: fix entity use_count issue for dual sensors :::::: branch date: 10 days ago :::::: commit date: 4 months ago config: i386-randconfig-c001-20211021 (attached as .config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 3cea2505fd8d99a9ba0cb625aecfe28a47c4e3f8) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel/linux-intel-lts/commit/91c71f14b406b0fe0f72f7e75e6a85e344b1927a git remote add intel-lts https://github.com/intel/linux-intel-lts.git git fetch --no-tags intel-lts 5.10/preempt-rt git checkout 91c71f14b406b0fe0f72f7e75e6a85e344b1927a # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 clang-analyzer If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> clang-analyzer warnings: (new ones prefixed by >>) for (pos = list_first_entry(head, typeof(*pos), member); \ ^ include/linux/list.h:522:2: note: expanded from macro 'list_first_entry' list_entry((ptr)->next, type, member) ^ include/linux/list.h:511:2: note: expanded from macro 'list_entry' container_of(ptr, type, member) ^ note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/compiler_types.h:315:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:303:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:295:3: note: expanded from macro '__compiletime_assert' if (!(condition)) \ ^ drivers/hwmon/w83793.c:1301:2: note: Loop condition is false. Exiting loop list_for_each_entry(pos, &watchdog_data_list, list) { ^ include/linux/list.h:628:13: note: expanded from macro 'list_for_each_entry' for (pos = list_first_entry(head, typeof(*pos), member); \ ^ include/linux/list.h:522:2: note: expanded from macro 'list_first_entry' list_entry((ptr)->next, type, member) ^ include/linux/list.h:511:2: note: expanded from macro 'list_entry' container_of(ptr, type, member) ^ note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/compiler_types.h:315:2: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:303:2: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:293:2: note: expanded from macro '__compiletime_assert' do { \ ^ drivers/hwmon/w83793.c:1301:2: note: Loop condition is false. Execution continues on line 1309 list_for_each_entry(pos, &watchdog_data_list, list) { ^ include/linux/list.h:628:2: note: expanded from macro 'list_for_each_entry' for (pos = list_first_entry(head, typeof(*pos), member); \ ^ drivers/hwmon/w83793.c:1315:6: note: Assuming 'watchdog_is_open' is 0 if (!watchdog_is_open) ^~~~~~~~~~~~~~~~~ drivers/hwmon/w83793.c:1315:2: note: Taking true branch if (!watchdog_is_open) ^ drivers/hwmon/w83793.c:1321:6: note: 'watchdog_is_open' is 0 if (watchdog_is_open) ^~~~~~~~~~~~~~~~ drivers/hwmon/w83793.c:1321:2: note: Taking false branch if (watchdog_is_open) ^ drivers/hwmon/w83793.c:1325:18: note: Passing null pointer value via 1st parameter 'data' watchdog_enable(data); ^~~~ drivers/hwmon/w83793.c:1325:2: note: Calling 'watchdog_enable' watchdog_enable(data); ^~~~~~~~~~~~~~~~~~~~~ drivers/hwmon/w83793.c:1253:7: note: Access to field 'client' results in a dereference of a null pointer (loaded from variable 'data') if (!data->client) { ^~~~ Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. Suppressed 4 warnings (3 in non-user code, 1 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 2 warnings generated. Suppressed 2 warnings (2 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 5 warnings generated. drivers/media/v4l2-core/v4l2-mc.c:176:4: warning: Value stored to 'if_aud' is never read [clang-analyzer-deadcode.DeadStores] if_aud = tuner; ^ ~~~~~ drivers/media/v4l2-core/v4l2-mc.c:176:4: note: Value stored to 'if_aud' is never read if_aud = tuner; ^ ~~~~~ >> drivers/media/v4l2-core/v4l2-mc.c:437:23: warning: Value stored to 'entity' >> during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct media_entity *entity = pad->entity; ^~~~~~ ~~~~~~~~~~~ drivers/media/v4l2-core/v4l2-mc.c:437:23: note: Value stored to 'entity' during its initialization is never read struct media_entity *entity = pad->entity; ^~~~~~ ~~~~~~~~~~~ Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. Suppressed 4 warnings (3 in non-user code, 1 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 5 warnings generated. fs/overlayfs/super.c:1714:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores] err = -EINVAL; ^ ~~~~~~~ fs/overlayfs/super.c:1714:2: note: Value stored to 'err' is never read err = -EINVAL; ^ ~~~~~~~ Suppressed 4 warnings (4 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. fs/overlayfs/namei.c:55:2: warning: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy] strcat(buf, post); ^~~~~~ fs/overlayfs/namei.c:55:2: note: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119 strcat(buf, post); ^~~~~~ Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 9 warnings generated. Suppressed 9 warnings (3 in non-user code, 6 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. net/core/net-sysfs.c:1703:2: warning: Value stored to 'txq' is never read [clang-analyzer-deadcode.DeadStores] txq = real_tx; ^ ~~~~~~~ net/core/net-sysfs.c:1703:2: note: Value stored to 'txq' is never read txq = real_tx; ^ ~~~~~~~ Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 37 warnings generated. Suppressed 37 warnings (37 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. vim +/entity +437 drivers/media/v4l2-core/v4l2-mc.c 0d3c81e82da90f Steve Longerbeam 2020-05-01 406 76413791a03f8f Sakari Ailus 2016-02-21 407 /* ----------------------------------------------------------------------------- 76413791a03f8f Sakari Ailus 2016-02-21 408 * Pipeline power management 76413791a03f8f Sakari Ailus 2016-02-21 409 * 76413791a03f8f Sakari Ailus 2016-02-21 410 * Entities must be powered up when part of a pipeline that contains at least 76413791a03f8f Sakari Ailus 2016-02-21 411 * one open video device node. 76413791a03f8f Sakari Ailus 2016-02-21 412 * 76413791a03f8f Sakari Ailus 2016-02-21 413 * To achieve this use the entity use_count field to track the number of users. 76413791a03f8f Sakari Ailus 2016-02-21 414 * For entities corresponding to video device nodes the use_count field stores 76413791a03f8f Sakari Ailus 2016-02-21 415 * the users count of the node. For entities corresponding to subdevs the 76413791a03f8f Sakari Ailus 2016-02-21 416 * use_count field stores the total number of users of all video device nodes 76413791a03f8f Sakari Ailus 2016-02-21 417 * in the pipeline. 76413791a03f8f Sakari Ailus 2016-02-21 418 * 8fd390b89cc8ca Ezequiel Garcia 2020-01-24 419 * The v4l2_pipeline_pm_{get, put}() functions must be called in the open() and 76413791a03f8f Sakari Ailus 2016-02-21 420 * close() handlers of video device nodes. It increments or decrements the use 76413791a03f8f Sakari Ailus 2016-02-21 421 * count of all subdev entities in the pipeline. 76413791a03f8f Sakari Ailus 2016-02-21 422 * 76413791a03f8f Sakari Ailus 2016-02-21 423 * To react to link management on powered pipelines, the link setup notification 76413791a03f8f Sakari Ailus 2016-02-21 424 * callback updates the use count of all entities in the source and sink sides 76413791a03f8f Sakari Ailus 2016-02-21 425 * of the link. 76413791a03f8f Sakari Ailus 2016-02-21 426 */ 76413791a03f8f Sakari Ailus 2016-02-21 427 76413791a03f8f Sakari Ailus 2016-02-21 428 /* 76413791a03f8f Sakari Ailus 2016-02-21 429 * pipeline_pm_use_count - Count the number of users of a pipeline 76413791a03f8f Sakari Ailus 2016-02-21 430 * @entity: The entity 76413791a03f8f Sakari Ailus 2016-02-21 431 * 76413791a03f8f Sakari Ailus 2016-02-21 432 * Return the total number of users of all video device nodes in the pipeline. 76413791a03f8f Sakari Ailus 2016-02-21 433 */ 91c71f14b406b0 Li Wei 2018-01-17 434 static int pipeline_pm_use_count(struct media_pad *pad, 20b852273642f4 Sakari Ailus 2016-11-21 435 struct media_graph *graph) 76413791a03f8f Sakari Ailus 2016-02-21 436 { 91c71f14b406b0 Li Wei 2018-01-17 @437 struct media_entity *entity = pad->entity; 76413791a03f8f Sakari Ailus 2016-02-21 438 int use = 0; 76413791a03f8f Sakari Ailus 2016-02-21 439 91c71f14b406b0 Li Wei 2018-01-17 440 media_graph_walk_start(graph, pad); 76413791a03f8f Sakari Ailus 2016-02-21 441 20b852273642f4 Sakari Ailus 2016-11-21 442 while ((entity = media_graph_walk_next(graph))) { 45b46879a78567 Laurent Pinchart 2016-02-29 443 if (is_media_entity_v4l2_video_device(entity)) 76413791a03f8f Sakari Ailus 2016-02-21 444 use += entity->use_count; 76413791a03f8f Sakari Ailus 2016-02-21 445 } 76413791a03f8f Sakari Ailus 2016-02-21 446 76413791a03f8f Sakari Ailus 2016-02-21 447 return use; 76413791a03f8f Sakari Ailus 2016-02-21 448 } 76413791a03f8f Sakari Ailus 2016-02-21 449 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected]
.config.gz
Description: application/gzip
_______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
