linux-stable/drivers
Guenter Roeck 7aeef1548a hwmon: (lm90) Fix error return value from detect function
lm90_detect_nuvoton() is supposed to return NULL if it can not detect
a chip, or a pointer to the chip name if it does. Under some circumstances
it returns an error pointer instead. Some versions of gcc interpret an
ERR_PTR as region of size 0 and generate an error message.

  In function ‘__fortify_strlen’,
      inlined from ‘strlcpy’ at ./include/linux/fortify-string.h:159:10,
      inlined from ‘lm90_detect’ at drivers/hwmon/lm90.c:2550:2:
  ./include/linux/fortify-string.h:50:33: error:
      ‘__builtin_strlen’ reading 1 or more bytes from a region of size 0
     50 | #define __underlying_strlen     __builtin_strlen
        |                                 ^
  ./include/linux/fortify-string.h:141:24: note:
      in expansion of macro ‘__underlying_strlen’
    141 |                 return __underlying_strlen(p);
        |                        ^~~~~~~~~~~~~~~~~~~

Returning NULL instead of ERR_PTR() fixes the problem.

Fixes: c7cebce984 ("hwmon: (lm90) Rework detect function")
Reported-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Kees Cook <keescook@chromium.org>
Tested-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-08-10 00:49:46 -07:00
..
accessibility TTY / Serial driver changes for 6.0-rc1 2022-08-08 11:31:40 -07:00
acpi IOMMU Updates for Linux v5.20/v6.0: 2022-08-06 10:42:38 -07:00
amba
android - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
ata powerpc updates for 6.0 2022-08-06 16:38:17 -07:00
atm
auxdisplay
base Driver core / kernfs changes for 6.0-rc1 2022-08-04 11:31:20 -07:00
bcma
block - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
bluetooth SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
bus SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
cdrom
char s390 updates for 5.20 merge window 2022-08-06 17:05:21 -07:00
clk The clk core gains a new set of APIs that allow drivers to both acquire clks 2022-08-04 18:40:08 -07:00
clocksource RISC-V Patches for the 5.20 Merge Window, Part 1 2022-08-06 15:04:48 -07:00
comedi pci-v5.20-changes 2022-08-04 19:30:35 -07:00
connector
counter
cpufreq More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
cpuidle More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
crypto This update includes the following changes: 2022-08-02 17:45:14 -07:00
cxl
dax
dca
devfreq More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
dio
dma pci-v5.20-changes 2022-08-04 19:30:35 -07:00
dma-buf drm for 5.20/6.0 2022-08-03 19:52:08 -07:00
edac powerpc updates for 6.0 2022-08-06 16:38:17 -07:00
eisa
extcon
firewire
firmware RISC-V Patches for the 5.20 Merge Window, Part 1 2022-08-06 15:04:48 -07:00
fpga
fsi
gnss
gpio gpio: updates for v6.0-rc1 2022-08-04 18:34:05 -07:00
gpu More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
greybus
hid platform-drivers-x86 for v6.0-1 2022-08-04 18:19:14 -07:00
hsi
hte
hv
hwmon hwmon: (lm90) Fix error return value from detect function 2022-08-10 00:49:46 -07:00
hwspinlock
hwtracing asm-generic: updates for 6.0 2022-08-05 10:07:23 -07:00
i2c powerpc updates for 6.0 2022-08-06 16:38:17 -07:00
i3c
idle
iio
infiniband dma-mapping updates 2022-08-06 10:56:45 -07:00
input parisc architecture fixes and updates for kernel v5.20-rc1: 2022-08-05 09:58:58 -07:00
interconnect
iommu Bitmap patches for v6.0-rc1 2022-08-07 17:52:35 -07:00
ipack
irqchip RISC-V Patches for the 5.20 Merge Window, Part 1 2022-08-06 15:04:48 -07:00
isdn
leds LED updates for 5.20: new driver for bcm63138, is31fl319x updates, 2022-08-08 11:36:21 -07:00
macintosh
mailbox - mtk: use rx_callback instead of cmdq_task_cb. 2022-08-08 10:19:40 -07:00
mcb
md - Add flags argument to dm_bufio_client_create and introduce 2022-08-06 11:09:55 -07:00
media More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
memory More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
memstick MMC core: 2022-08-04 19:41:09 -07:00
message
mfd - Core Frameworks 2022-08-06 10:25:16 -07:00
misc - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
mmc MMC core: 2022-08-04 19:41:09 -07:00
most
mtd MTD core changes: 2022-08-05 14:13:45 -07:00
mux
net Bitmap patches for v6.0-rc1 2022-08-07 17:52:35 -07:00
nfc
ntb
nubus
nvdimm - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
nvme dma-mapping updates 2022-08-06 10:56:45 -07:00
nvmem SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
of TTY / Serial driver changes for 6.0-rc1 2022-08-08 11:31:40 -07:00
opp OPP updates for 5.20-rc1 2022-08-03 17:49:38 +02:00
parisc parisc architecture fixes and updates for kernel v5.20-rc1: 2022-08-05 09:58:58 -07:00
parport
pci dma-mapping updates 2022-08-06 10:56:45 -07:00
pcmcia
peci
perf
phy pci-v5.20-changes 2022-08-04 19:30:35 -07:00
pinctrl platform-drivers-x86 for v6.0-1 2022-08-04 18:19:14 -07:00
platform platform-drivers-x86 for v6.0-1 2022-08-04 18:19:14 -07:00
pnp
power platform-drivers-x86 for v6.0-1 2022-08-04 18:19:14 -07:00
powercap
pps
ps3
ptp SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
pwm SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
rapidio
ras
regulator chrome platform changes for 5.20 2022-08-04 18:13:19 -07:00
remoteproc remoteproc: qcom_q6v5_pas: Do not fail if regulators are not found 2022-08-08 10:32:17 -05:00
reset ARM: SoC: late updates for 6.0 2022-08-05 10:02:33 -07:00
rpmsg
rtc
s390 s390 updates for 5.20 merge window 2022-08-06 17:05:21 -07:00
sbus
scsi powerpc updates for 6.0 2022-08-06 16:38:17 -07:00
sh
siox
slimbus
soc More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
soundwire sound updates for 6.0-rc1 2022-08-06 10:19:51 -07:00
spi powerpc updates for 6.0 2022-08-06 16:38:17 -07:00
spmi
ssb
staging Staging driver patches for 6.0-rc1 2022-08-04 12:01:42 -07:00
target SCSI misc on 20220804 2022-08-04 19:47:37 -07:00
tc
tee
thermal More thermal control updates for 5.20-rc1 2022-08-08 14:23:37 -07:00
thunderbolt USB / Thunderbolt changes for 6.0-rc1 2022-08-04 11:41:28 -07:00
tty TTY / Serial driver changes for 6.0-rc1 2022-08-08 11:31:40 -07:00
ufs SCSI misc on 20220804 2022-08-04 19:47:37 -07:00
uio
usb TTY / Serial driver changes for 6.0-rc1 2022-08-08 11:31:40 -07:00
vdpa
vfio VFIO updates for v6.0-rc1 2022-08-06 08:59:35 -07:00
vhost iov_iter: advancing variants of iov_iter_get_pages{,_alloc}() 2022-08-08 22:37:22 -04:00
video TTY / Serial driver changes for 6.0-rc1 2022-08-08 11:31:40 -07:00
virt Char / Misc driver changes for 6.0-rc1 2022-08-04 11:05:48 -07:00
virtio - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
vlynq
w1
watchdog linux-watchdog 5.20-rc1 tag 2022-08-08 15:04:04 -07:00
xen - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
zorro
Kconfig
Makefile Staging driver patches for 6.0-rc1 2022-08-04 12:01:42 -07:00