linux-stable/drivers/char
Alexander Steffen 03f60a67e7 tpm_tis: Explicitly check for error code
commit 513253f8c2 upstream.

recv_data either returns the number of received bytes, or a negative value
representing an error code. Adding the return value directly to the total
number of received bytes therefore looks a little weird, since it might add
a negative error code to a sum of bytes.

The following check for size < expected usually makes the function return
ETIME in that case, so it does not cause too many problems in practice. But
to make the code look cleaner and because the caller might still be
interested in the original error code, explicitly check for the presence of
an error code and pass that through.

Cc: stable@vger.kernel.org
Fixes: cb5354253a ("[PATCH] tpm: spacing cleanups 2")
Signed-off-by: Alexander Steffen <Alexander.Steffen@infineon.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 11:45:34 +02:00
..
agp parisc/agp: Annotate parisc agp init functions with __init 2021-12-22 09:19:00 +01:00
hw_random hwrng: imx-rngc - fix the timeout for init and self check 2023-08-11 11:45:22 +02:00
ipmi ipmi: move message error checking to avoid deadlock 2023-06-28 10:15:28 +02:00
mwave char/mwave: Adjust io port register size 2022-01-27 09:04:22 +01:00
pcmcia char: pcmcia: error out if 'num_bytes_read' is greater than 4 in set_protocol() 2021-07-20 16:15:55 +02:00
tpm tpm_tis: Explicitly check for error code 2023-08-11 11:45:34 +02:00
xilinx_hwicap
xillybus
Kconfig random: credit cpu and bootloader seeds by default 2022-06-25 11:49:15 +02:00
Makefile
adi.c
apm-emulation.c
applicom.c
applicom.h
bsr.c
ds1620.c
dsp56k.c
dtlk.c
efirtc.c
generic_nvram.c
hangcheck-timer.c
hpet.c char: hpet: add checks after calling ioremap 2021-06-03 08:38:09 +02:00
lp.c lp: fix sparc64 LPSETTIMEOUT ioctl 2019-12-13 08:50:58 +01:00
mbcs.c
mbcs.h
mem.c random: restore O_NONBLOCK support 2022-10-26 13:19:19 +02:00
misc.c
mspec.c
nsc_gpio.c
nvram.c
nwbutton.c
nwbutton.h
nwflash.c
pc8736x_gpio.c
powernv-op-panel.c
ppdev.c ppdev: fix PPGETTIME/PPSETTIME ioctls 2019-12-17 20:35:13 +01:00
ps3flash.c
random.c random: use expired timer rather than wq for mixing fast pool 2022-10-26 13:19:19 +02:00
raw.c
rtc.c
scx200_gpio.c
snsc.c
snsc.h
snsc_event.c
sonypi.c
tb0219.c
tlclk.c drivers: char: tlclk.c: Avoid data race between init and interrupt handler 2020-10-01 13:14:42 +02:00
toshiba.c
ttyprintk.c ttyprintk: Add TTY hangup callback. 2021-05-22 10:59:32 +02:00
uv_mmtimer.c
virtio_console.c virtio_console: eliminate anonymous module_init & module_exit 2022-04-15 14:15:04 +02:00