alistair23-linux/drivers/char
Arnd Bergmann 21feadd024 ipmi: ipmb: don't allocate i2c_client on stack
The i2c_client structure can be fairly large, which leads to
a warning about possible kernel stack overflow in some
configurations:

drivers/char/ipmi/ipmb_dev_int.c:115:16: error: stack frame size of 1032 bytes in function 'ipmb_write' [-Werror,-Wframe-larger-than=]

There is no real reason to even declare an i2c_client, as we can simply
call i2c_smbus_xfer() directly instead of the i2c_smbus_write_block_data()
wrapper.

Convert the ipmb_write() to use an open-coded i2c_smbus_write_block_data()
here, without changing the behavior.

It seems that there is another problem with this implementation;
when user space passes a length of more than I2C_SMBUS_BLOCK_MAX
bytes, all the rest is silently ignored. This should probably be
addressed in a separate patch, but I don't know what the intended
behavior is here.

Fixes: 51bd6f2915 ("Add support for IPMB driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Message-Id: <20190619125045.918700-1-arnd@arndb.de>
Acked-by: Asmaa Mnebhi <Asmaa@mellanox.com>
[Broke up a line >80 characters on i2c_smbus_xfer().]
Signed-off-by: Corey Minyard <cminyard@mvista.com>
2019-06-19 09:03:55 -05:00
..
agp agp: efficeon: no need to set PG_reserved on GATT tables 2019-03-05 21:07:18 -08:00
hw_random hwrng: stm32 - set default random quality 2019-04-15 17:35:10 +08:00
ipmi ipmi: ipmb: don't allocate i2c_client on stack 2019-06-19 09:03:55 -05:00
mwave char/mwave: fix potential Spectre v1 vulnerability 2019-01-18 16:42:05 +01:00
pcmcia *: convert stream-like files from nonseekable_open -> stream_open 2019-05-06 17:46:41 +03:00
tpm pidfd patches for v5.2-rc1 2019-05-07 12:30:24 -07:00
xilinx_hwicap
xillybus
adi.c
apm-emulation.c
applicom.c applicom: Fix potential Spectre v1 vulnerabilities 2019-01-22 13:34:35 +01:00
applicom.h
bsr.c
ds1620.c *: convert stream-like files from nonseekable_open -> stream_open 2019-05-06 17:46:41 +03:00
dsp56k.c
dtlk.c *: convert stream-like files from nonseekable_open -> stream_open 2019-05-06 17:46:41 +03:00
efirtc.c efirtc: remove unnecessary code efi_rtc_open & efi_rtc_close 2019-01-22 13:19:12 +01:00
hangcheck-timer.c
hpet.c char: hpet: fix a missing check of ioremap 2019-03-28 02:15:51 +09:00
Kconfig tty: mark Siemens R3964 line discipline as BROKEN 2019-04-05 05:56:44 -10:00
lp.c char: lp: mark expected switch fall-through 2019-02-13 19:45:57 +01:00
Makefile char/generic_nvram: Remove as unused 2019-01-22 10:21:45 +01:00
mbcs.c mbcs: add .owner to mbcs struct file_operations 2019-01-22 14:56:00 +01:00
mbcs.h
mem.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
misc.c
mspec.c
nsc_gpio.c
nvram.c powerpc: Adopt nvram module for PPC64 2019-01-22 10:21:45 +01:00
nwbutton.c
nwbutton.h
nwflash.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
pc8736x_gpio.c
powernv-op-panel.c
ppdev.c
ps3flash.c
random.c random: add a spinlock_t to struct batched_entropy 2019-04-20 00:09:56 -04:00
raw.c
rtc.c
scx200_gpio.c
snsc.c
snsc.h
snsc_event.c
sonypi.c
tb0219.c *: convert stream-like files from nonseekable_open -> stream_open 2019-05-06 17:46:41 +03:00
tlclk.c
toshiba.c
ttyprintk.c
uv_mmtimer.c
virtio_console.c virtio_console: initialize vtermno value for ports 2019-03-28 01:28:24 +09:00