TencentOS-kernel/drivers/soc
Dan Carpenter 3d5a8e2156 soc: aspeed: fix a ternary sign expansion bug
[ Upstream commit 5ffa828534036348fa90fb3079ccc0972d202c4a ]

The intent here was to return negative error codes but it actually
returns positive values.  The problem is that type promotion with
ternary operations is quite complicated.

"ret" is an int.  "copied" is a u32.  And the snoop_file_read() function
returns long.  What happens is that "ret" is cast to u32 and becomes
positive then it's cast to long and it's still positive.

Fix this by removing the ternary so that "ret" is type promoted directly
to long.

Fixes: 3772e5da4454 ("drivers/misc: Aspeed LPC snoop output using misc chardev")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Patrick Venture <venture@google.com>
Link: https://lore.kernel.org/r/YIE90PSXsMTa2Y8n@mwanda
Link: https://lore.kernel.org/r/20210423000919.1249474-1-joel@jms.id.au'
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-20 16:07:52 +08:00
..
actions Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
amlogic soc: amlogic: canvas: add missing put_device() call in meson_canvas_get() 2021-03-16 16:42:57 +08:00
aspeed soc: aspeed: fix a ternary sign expansion bug 2021-05-20 16:07:52 +08:00
atmel drivers: soc: atmel: add null entry at the end of at91_soc_allowed_list[] 2021-04-12 12:51:44 +08:00
bcm Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
dove Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
fsl soc/fsl: qbman: fix conflicting alignment attributes 2021-05-20 16:07:01 +08:00
gemini Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
imx soc: imx: gpc: fix power up sequencing 2021-03-16 16:26:33 +08:00
ixp4xx Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
lantiq Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mediatek soc: mediatek: Check if power domains can be powered on at boot time 2021-03-16 16:42:36 +08:00
qcom soc: qcom: mdt_loader: Detect truncated read of segments 2021-05-20 16:07:49 +08:00
renesas soc: renesas: rmobile-sysc: Fix some leaks in rmobile_init_pm_domains() 2021-03-16 16:42:36 +08:00
rockchip Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
samsung Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sunxi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tegra soc/tegra: fuse: Fix index bug in get_process_id 2021-03-16 16:42:30 +08:00
ti drivers: soc: ti: knav_qmss_queue: Fix error return code in knav_queue_probe 2021-03-16 16:42:50 +08:00
ux500 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
versatile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
xilinx drivers: soc: xilinx: fix firmware driver Kconfig dependency 2021-03-16 16:27:07 +08:00
zte Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00