lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202211231439.JvHydxrP-lkp@intel.com>
Date:   Wed, 23 Nov 2022 14:20:39 +0800
From:   kernel test robot <lkp@...el.com>
To:     Peng Zhang <zhangpeng362@...wei.com>, pavel@....cz,
        andersson@...nel.org, swboyd@...omium.org,
        quic_c_skakit@...cinc.com, marijn.suijten@...ainline.org
Cc:     llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
        linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org,
        ZhangPeng <zhangpeng362@...wei.com>
Subject: Re: [PATCH] leds: call of_node_put() when breaking out of
 for_each_available_child_of_node()

Hi Peng,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v6.1-rc6 next-20221122]
[cannot apply to pavel-leds/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Peng-Zhang/leds-call-of_node_put-when-breaking-out-of-for_each_available_child_of_node/20221122-142530
patch link:    https://lore.kernel.org/r/20221122065002.2327772-1-zhangpeng362%40huawei.com
patch subject: [PATCH] leds: call of_node_put() when breaking out of for_each_available_child_of_node()
config: riscv-randconfig-r014-20221120
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project af8c49dc1ec44339d915d988ffe0f38da68ca0e7)
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
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/intel-lab-lkp/linux/commit/013aed0a135439317bd90a015567b9c955e50445
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Peng-Zhang/leds-call-of_node_put-when-breaking-out-of-for_each_available_child_of_node/20221122-142530
        git checkout 013aed0a135439317bd90a015567b9c955e50445
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/leds/rgb/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All errors (new ones prefixed by >>):

>> drivers/leds/rgb/leds-qcom-lpg.c:1097:16: error: expected ';' after expression
                   ret = -ENOMEM
                                ^
                                ;
   drivers/leds/rgb/leds-qcom-lpg.c:1107:17: error: expected ';' after expression
                           ret = -ENOMEM
                                        ^
                                        ;
   2 errors generated.


vim +1097 drivers/leds/rgb/leds-qcom-lpg.c

  1070	
  1071	static int lpg_add_led(struct lpg *lpg, struct device_node *np)
  1072	{
  1073		struct led_init_data init_data = {};
  1074		struct led_classdev *cdev;
  1075		struct device_node *child;
  1076		struct mc_subled *info;
  1077		struct lpg_led *led;
  1078		const char *state;
  1079		int num_channels;
  1080		u32 color = 0;
  1081		int ret;
  1082		int i;
  1083	
  1084		ret = of_property_read_u32(np, "color", &color);
  1085		if (ret < 0 && ret != -EINVAL) {
  1086			dev_err(lpg->dev, "failed to parse \"color\" of %pOF\n", np);
  1087			goto err_put_np_node;
  1088		}
  1089	
  1090		if (color == LED_COLOR_ID_RGB)
  1091			num_channels = of_get_available_child_count(np);
  1092		else
  1093			num_channels = 1;
  1094	
  1095		led = devm_kzalloc(lpg->dev, struct_size(led, channels, num_channels), GFP_KERNEL);
  1096		if (!led) {
> 1097			ret = -ENOMEM
  1098			goto err_put_np_node;
  1099		}
  1100	
  1101		led->lpg = lpg;
  1102		led->num_channels = num_channels;
  1103	
  1104		if (color == LED_COLOR_ID_RGB) {
  1105			info = devm_kcalloc(lpg->dev, num_channels, sizeof(*info), GFP_KERNEL);
  1106			if (!info) {
  1107				ret = -ENOMEM
  1108				goto err_put_np_node;
  1109			}
  1110			i = 0;
  1111			for_each_available_child_of_node(np, child) {
  1112				ret = lpg_parse_channel(lpg, child, &led->channels[i]);
  1113				if (ret < 0)
  1114					goto err_put_child_node;
  1115	
  1116				info[i].color_index = led->channels[i]->color;
  1117				info[i].intensity = 0;
  1118				i++;
  1119			}
  1120	
  1121			led->mcdev.subled_info = info;
  1122			led->mcdev.num_colors = num_channels;
  1123	
  1124			cdev = &led->mcdev.led_cdev;
  1125			cdev->brightness_set = lpg_brightness_mc_set;
  1126			cdev->blink_set = lpg_blink_mc_set;
  1127	
  1128			/* Register pattern accessors only if we have a LUT block */
  1129			if (lpg->lut_base) {
  1130				cdev->pattern_set = lpg_pattern_mc_set;
  1131				cdev->pattern_clear = lpg_pattern_mc_clear;
  1132			}
  1133		} else {
  1134			ret = lpg_parse_channel(lpg, np, &led->channels[0]);
  1135			if (ret < 0)
  1136				goto err_put_np_node;
  1137	
  1138			cdev = &led->cdev;
  1139			cdev->brightness_set = lpg_brightness_single_set;
  1140			cdev->blink_set = lpg_blink_single_set;
  1141	
  1142			/* Register pattern accessors only if we have a LUT block */
  1143			if (lpg->lut_base) {
  1144				cdev->pattern_set = lpg_pattern_single_set;
  1145				cdev->pattern_clear = lpg_pattern_single_clear;
  1146			}
  1147		}
  1148	
  1149		cdev->default_trigger = of_get_property(np, "linux,default-trigger", NULL);
  1150		cdev->max_brightness = LPG_RESOLUTION - 1;
  1151	
  1152		if (!of_property_read_string(np, "default-state", &state) &&
  1153		    !strcmp(state, "on"))
  1154			cdev->brightness = cdev->max_brightness;
  1155		else
  1156			cdev->brightness = LED_OFF;
  1157	
  1158		cdev->brightness_set(cdev, cdev->brightness);
  1159	
  1160		init_data.fwnode = of_fwnode_handle(np);
  1161	
  1162		if (color == LED_COLOR_ID_RGB)
  1163			ret = devm_led_classdev_multicolor_register_ext(lpg->dev, &led->mcdev, &init_data);
  1164		else
  1165			ret = devm_led_classdev_register_ext(lpg->dev, &led->cdev, &init_data);
  1166		if (ret)
  1167			dev_err(lpg->dev, "unable to register %s\n", cdev->name);
  1168		else
  1169			return ret;
  1170	
  1171	err_put_np_node:
  1172		of_node_put(np);
  1173		return ret;
  1174	
  1175	err_put_child_node:
  1176		of_node_put(child);
  1177		return ret;
  1178	}
  1179	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (159262 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ