From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [linux-next:master 865/14705] drivers/iio/adc/ad4130.c:1527 ad4130_validate_diff_channel() error: buffer overflow 'st->pins_fn' 16 <= 29
Date: Tue, 23 Jun 2026 02:15:26 +0800 [thread overview]
Message-ID: <202606230258.7nyjvsEO-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Jonathan Santos <Jonathan.Santos@analog.com>
CC: Jonathan Cameron <jic23@kernel.org>
CC: Andy Shevchenko <andriy.shevchenko@intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 3ce97bd3c4f18608335e709c24d6a40e7036cab8
commit: 71c1a1b376b3a7520c8f59f81ab6a28d77938ff5 [865/14705] iio: adc: ad4130: introduce chip info for future multidevice support
:::::: branch date: 3 days ago
:::::: commit date: 8 weeks ago
config: openrisc-randconfig-r071-20260622 (https://download.01.org/0day-ci/archive/20260623/202606230258.7nyjvsEO-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 16.1.0
smatch: v0.5.0-9185-gbcc58b9c
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@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202606230258.7nyjvsEO-lkp@intel.com/
New smatch warnings:
drivers/iio/adc/ad4130.c:1527 ad4130_validate_diff_channel() error: buffer overflow 'st->pins_fn' 16 <= 29
Old smatch warnings:
drivers/iio/adc/ad4130.c:1530 ad4130_validate_diff_channel() error: buffer overflow 'st->pins_fn' 16 <= 29
drivers/iio/adc/ad4130.c:1532 ad4130_validate_diff_channel() error: buffer overflow 'st->pins_fn' 16 <= 29
vim +1527 drivers/iio/adc/ad4130.c
62094060cf3acaf Cosmin Tanislav 2022-10-21 1515
62094060cf3acaf Cosmin Tanislav 2022-10-21 1516 static int ad4130_validate_diff_channel(struct ad4130_state *st, u32 pin)
62094060cf3acaf Cosmin Tanislav 2022-10-21 1517 {
62094060cf3acaf Cosmin Tanislav 2022-10-21 1518 struct device *dev = &st->spi->dev;
62094060cf3acaf Cosmin Tanislav 2022-10-21 1519
62094060cf3acaf Cosmin Tanislav 2022-10-21 1520 if (pin >= AD4130_MAX_DIFF_INPUTS)
62094060cf3acaf Cosmin Tanislav 2022-10-21 1521 return dev_err_probe(dev, -EINVAL,
6abcb19e0a6a371 Colin Ian King 2022-11-04 1522 "Invalid differential channel %u\n", pin);
62094060cf3acaf Cosmin Tanislav 2022-10-21 1523
71c1a1b376b3a75 Jonathan Santos 2026-04-01 1524 if (pin >= st->chip_info->max_analog_pins)
62094060cf3acaf Cosmin Tanislav 2022-10-21 1525 return 0;
62094060cf3acaf Cosmin Tanislav 2022-10-21 1526
62094060cf3acaf Cosmin Tanislav 2022-10-21 @1527 if (st->pins_fn[pin] == AD4130_PIN_FN_SPECIAL)
62094060cf3acaf Cosmin Tanislav 2022-10-21 1528 return dev_err_probe(dev, -EINVAL,
62094060cf3acaf Cosmin Tanislav 2022-10-21 1529 "Pin %u already used with fn %u\n", pin,
62094060cf3acaf Cosmin Tanislav 2022-10-21 1530 st->pins_fn[pin]);
62094060cf3acaf Cosmin Tanislav 2022-10-21 1531
62094060cf3acaf Cosmin Tanislav 2022-10-21 1532 st->pins_fn[pin] |= AD4130_PIN_FN_DIFF;
62094060cf3acaf Cosmin Tanislav 2022-10-21 1533
62094060cf3acaf Cosmin Tanislav 2022-10-21 1534 return 0;
62094060cf3acaf Cosmin Tanislav 2022-10-21 1535 }
62094060cf3acaf Cosmin Tanislav 2022-10-21 1536
:::::: The code at line 1527 was first introduced by commit
:::::: 62094060cf3acaf52e277457d807ea753269b89e iio: adc: ad4130: add AD4130 driver
:::::: TO: Cosmin Tanislav <cosmin.tanislav@analog.com>
:::::: CC: Jonathan Cameron <Jonathan.Cameron@huawei.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-06-22 18:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202606230258.7nyjvsEO-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.