tree: https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master head: a5d2ee08adc1d98647679c4e4c73223464d5d936 commit: 52d2af10759262ab95162ddc1a56faa8fe3aabde [78/83] Bluetooth: btbcm: Fix NULL deref in btbcm_get_board_name() config: i386-buildonly-randconfig-005-20250110 (https://download.01.org/0day-ci/archive/20250110/202501100521.pQA05bQH-lkp@xxxxxxxxx/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250110/202501100521.pQA05bQH-lkp@xxxxxxxxx/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@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202501100521.pQA05bQH-lkp@xxxxxxxxx/ All warnings (new ones prefixed by >>): drivers/bluetooth/btbcm.c: In function 'btbcm_get_board_name': >> drivers/bluetooth/btbcm.c:557:24: warning: returning 'int' from a function with return type 'const char *' makes pointer from integer without a cast [-Wint-conversion] 557 | return -ENOMEM; | ^ vim +557 drivers/bluetooth/btbcm.c 536 537 /* 538 * This currently only looks up the device tree board appendix, 539 * but can be expanded to other mechanisms. 540 */ 541 static const char *btbcm_get_board_name(struct device *dev) 542 { 543 #ifdef CONFIG_OF 544 struct device_node *root __free(device_node) = of_find_node_by_path("/"); 545 char *board_type; 546 const char *tmp; 547 548 if (!root) 549 return NULL; 550 551 if (of_property_read_string_index(root, "compatible", 0, &tmp)) 552 return NULL; 553 554 /* get rid of any '/' in the compatible string */ 555 board_type = devm_kstrdup(dev, tmp, GFP_KERNEL); 556 if (!board_type) > 557 return -ENOMEM; 558 559 strreplace(board_type, '/', '-'); 560 561 return board_type; 562 #else 563 return NULL; 564 #endif 565 } 566 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki