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]
Date:   Fri, 3 Jul 2020 12:38:18 +0800
From:   kernel test robot <lkp@...el.com>
To:     Bartosz Golaszewski <brgl@...ev.pl>,
        Jonathan Cameron <jic23@...nel.org>,
        Hartmut Knaack <knaack.h@....de>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Peter Meerwald-Stadler <pmeerw@...erw.net>,
        Michal Simek <monstr@...str.eu>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Guenter Roeck <linux@...ck-us.net>
Cc:     kbuild-all@...ts.01.org, clang-built-linux@...glegroups.com,
        linux-iio@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFT] iio: adc: xilinx-xadc: use devm_krealloc()

Hi Bartosz,

I love your patch! Yet something to improve:

[auto build test ERROR on iio/togreg]
[also build test ERROR on staging/staging-testing v5.8-rc3 next-20200702]
[cannot apply to xlnx/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use  as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Bartosz-Golaszewski/iio-adc-xilinx-xadc-use-devm_krealloc/20200703-002747
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project ca464639a1c9dd3944eb055ffd2796e8c2e7639f)
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 x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

All error/warnings (new ones prefixed by >>):

>> drivers/iio/adc/xilinx-xadc-core.c:1179:24: error: implicit declaration of function 'devm_krealloc' [-Werror,-Wimplicit-function-declaration]
           indio_dev->channels = devm_krealloc(dev, channels,
                                 ^
>> drivers/iio/adc/xilinx-xadc-core.c:1179:22: warning: incompatible integer to pointer conversion assigning to 'const struct iio_chan_spec *' from 'int' [-Wint-conversion]
           indio_dev->channels = devm_krealloc(dev, channels,
                               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning and 1 error generated.

vim +/devm_krealloc +1179 drivers/iio/adc/xilinx-xadc-core.c

  1093	
  1094	static int xadc_parse_dt(struct iio_dev *indio_dev, struct device_node *np,
  1095		unsigned int *conf)
  1096	{
  1097		struct device *dev = indio_dev->dev.parent;
  1098		struct xadc *xadc = iio_priv(indio_dev);
  1099		struct iio_chan_spec *channels, *chan;
  1100		struct device_node *chan_node, *child;
  1101		unsigned int num_channels;
  1102		const char *external_mux;
  1103		u32 ext_mux_chan;
  1104		u32 reg;
  1105		int ret;
  1106	
  1107		*conf = 0;
  1108	
  1109		ret = of_property_read_string(np, "xlnx,external-mux", &external_mux);
  1110		if (ret < 0 || strcasecmp(external_mux, "none") == 0)
  1111			xadc->external_mux_mode = XADC_EXTERNAL_MUX_NONE;
  1112		else if (strcasecmp(external_mux, "single") == 0)
  1113			xadc->external_mux_mode = XADC_EXTERNAL_MUX_SINGLE;
  1114		else if (strcasecmp(external_mux, "dual") == 0)
  1115			xadc->external_mux_mode = XADC_EXTERNAL_MUX_DUAL;
  1116		else
  1117			return -EINVAL;
  1118	
  1119		if (xadc->external_mux_mode != XADC_EXTERNAL_MUX_NONE) {
  1120			ret = of_property_read_u32(np, "xlnx,external-mux-channel",
  1121						&ext_mux_chan);
  1122			if (ret < 0)
  1123				return ret;
  1124	
  1125			if (xadc->external_mux_mode == XADC_EXTERNAL_MUX_SINGLE) {
  1126				if (ext_mux_chan == 0)
  1127					ext_mux_chan = XADC_REG_VPVN;
  1128				else if (ext_mux_chan <= 16)
  1129					ext_mux_chan = XADC_REG_VAUX(ext_mux_chan - 1);
  1130				else
  1131					return -EINVAL;
  1132			} else {
  1133				if (ext_mux_chan > 0 && ext_mux_chan <= 8)
  1134					ext_mux_chan = XADC_REG_VAUX(ext_mux_chan - 1);
  1135				else
  1136					return -EINVAL;
  1137			}
  1138	
  1139			*conf |= XADC_CONF0_MUX | XADC_CONF0_CHAN(ext_mux_chan);
  1140		}
  1141	
  1142		channels = devm_kmemdup(dev, xadc_channels,
  1143					sizeof(xadc_channels), GFP_KERNEL);
  1144		if (!channels)
  1145			return -ENOMEM;
  1146	
  1147		num_channels = 9;
  1148		chan = &channels[9];
  1149	
  1150		chan_node = of_get_child_by_name(np, "xlnx,channels");
  1151		if (chan_node) {
  1152			for_each_child_of_node(chan_node, child) {
  1153				if (num_channels >= ARRAY_SIZE(xadc_channels)) {
  1154					of_node_put(child);
  1155					break;
  1156				}
  1157	
  1158				ret = of_property_read_u32(child, "reg", &reg);
  1159				if (ret || reg > 16)
  1160					continue;
  1161	
  1162				if (of_property_read_bool(child, "xlnx,bipolar"))
  1163					chan->scan_type.sign = 's';
  1164	
  1165				if (reg == 0) {
  1166					chan->scan_index = 11;
  1167					chan->address = XADC_REG_VPVN;
  1168				} else {
  1169					chan->scan_index = 15 + reg;
  1170					chan->address = XADC_REG_VAUX(reg - 1);
  1171				}
  1172				num_channels++;
  1173				chan++;
  1174			}
  1175		}
  1176		of_node_put(chan_node);
  1177	
  1178		indio_dev->num_channels = num_channels;
> 1179		indio_dev->channels = devm_krealloc(dev, channels,
  1180						    sizeof(*channels) * num_channels,
  1181						    GFP_KERNEL);
  1182		/* If we can't resize the channels array, just use the original */
  1183		if (!indio_dev->channels)
  1184			indio_dev->channels = channels;
  1185	
  1186		return 0;
  1187	}
  1188	

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

Download attachment ".config.gz" of type "application/gzip" (74065 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ