android_kernel_motorola_sm6225/drivers/char/ipmi
Wen Yang 0721b549d3 ipmi: fix hung processes in __get_guid()
commit 32830a0534700f86366f371b150b17f0f0d140d7 upstream.

The wait_event() function is used to detect command completion.
When send_guid_cmd() returns an error, smi_send() has not been
called to send data. Therefore, wait_event() should not be used
on the error path, otherwise it will cause the following warning:

[ 1361.588808] systemd-udevd   D    0  1501   1436 0x00000004
[ 1361.588813]  ffff883f4b1298c0 0000000000000000 ffff883f4b188000 ffff887f7e3d9f40
[ 1361.677952]  ffff887f64bd4280 ffffc90037297a68 ffffffff8173ca3b ffffc90000000010
[ 1361.767077]  00ffc90037297ad0 ffff887f7e3d9f40 0000000000000286 ffff883f4b188000
[ 1361.856199] Call Trace:
[ 1361.885578]  [<ffffffff8173ca3b>] ? __schedule+0x23b/0x780
[ 1361.951406]  [<ffffffff8173cfb6>] schedule+0x36/0x80
[ 1362.010979]  [<ffffffffa071f178>] get_guid+0x118/0x150 [ipmi_msghandler]
[ 1362.091281]  [<ffffffff810d5350>] ? prepare_to_wait_event+0x100/0x100
[ 1362.168533]  [<ffffffffa071f755>] ipmi_register_smi+0x405/0x940 [ipmi_msghandler]
[ 1362.258337]  [<ffffffffa0230ae9>] try_smi_init+0x529/0x950 [ipmi_si]
[ 1362.334521]  [<ffffffffa022f350>] ? std_irq_setup+0xd0/0xd0 [ipmi_si]
[ 1362.411701]  [<ffffffffa0232bd2>] init_ipmi_si+0x492/0x9e0 [ipmi_si]
[ 1362.487917]  [<ffffffffa0232740>] ? ipmi_pci_probe+0x280/0x280 [ipmi_si]
[ 1362.568219]  [<ffffffff810021a0>] do_one_initcall+0x50/0x180
[ 1362.636109]  [<ffffffff812231b2>] ? kmem_cache_alloc_trace+0x142/0x190
[ 1362.714330]  [<ffffffff811b2ae1>] do_init_module+0x5f/0x200
[ 1362.781208]  [<ffffffff81123ca8>] load_module+0x1898/0x1de0
[ 1362.848069]  [<ffffffff811202e0>] ? __symbol_put+0x60/0x60
[ 1362.913886]  [<ffffffff8130696b>] ? security_kernel_post_read_file+0x6b/0x80
[ 1362.998514]  [<ffffffff81124465>] SYSC_finit_module+0xe5/0x120
[ 1363.068463]  [<ffffffff81124465>] ? SYSC_finit_module+0xe5/0x120
[ 1363.140513]  [<ffffffff811244be>] SyS_finit_module+0xe/0x10
[ 1363.207364]  [<ffffffff81003c04>] do_syscall_64+0x74/0x180

Fixes: 50c812b2b9 ("[PATCH] ipmi: add full sysfs support")
Signed-off-by: Wen Yang <wenyang@linux.alibaba.com>
Cc: Corey Minyard <minyard@acm.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: openipmi-developer@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org # 2.6.17-
Message-Id: <20200403090408.58745-1-wenyang@linux.alibaba.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-17 10:48:53 +02:00
..
bt-bmc.c ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_bt_sm.c ipmi: Move BT capabilities detection to the detect call 2018-08-31 08:42:59 -05:00
ipmi_devintf.c ipmi_devintf: Add an error return on invalid ioctls 2018-04-18 10:23:04 -05:00
ipmi_dmi.c ipmi:dmi: Ignore IPMI SMBIOS entries with a zero base address 2019-11-20 18:46:56 +01:00
ipmi_dmi.h ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_kcs_sm.c ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_msghandler.c ipmi: fix hung processes in __get_guid() 2020-04-17 10:48:53 +02:00
ipmi_powernv.c ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_poweroff.c ipmi: Rename ipmi_user_t to struct ipmi_user * 2018-04-18 10:22:55 -05:00
ipmi_si.h ipmi_si: Fix crash when using hard-coded device 2019-04-03 06:26:15 +02:00
ipmi_si_hardcode.c ipmi: ipmi_si_hardcode.c: init si_type array to fix a crash 2019-05-16 19:41:23 +02:00
ipmi_si_hotmod.c ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_si_intf.c ipmi_si: Only schedule continuously in the thread in maintenance mode 2019-10-07 18:56:39 +02:00
ipmi_si_mem_io.c ipmi_si: fix potential integer overflow on large shift 2019-11-20 18:46:56 +01:00
ipmi_si_parisc.c ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_si_pci.c ipmi_si_pci: fix NULL device in ipmi_si error message 2019-11-20 18:46:55 +01:00
ipmi_si_platform.c ipmi_si: Fix crash when using hard-coded device 2019-04-03 06:26:15 +02:00
ipmi_si_port_io.c ipmi_si: fix use-after-free of resource->name 2019-03-23 20:10:08 +01:00
ipmi_si_sm.h ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_smic_sm.c ipmi: Add or fix SPDX-License-Identifier in all files 2018-02-27 07:42:51 -06:00
ipmi_ssif.c ipmi:ssif: Handle a possible NULL pointer reference 2020-03-05 16:42:12 +01:00
ipmi_watchdog.c ipmi: Rename ipmi_user_t to struct ipmi_user * 2018-04-18 10:22:55 -05:00
Kconfig ipmi: Remove the proc interface 2018-05-09 12:21:46 -05:00
kcs_bmc.c ipmi: kcs_bmc: handle devm_kasprintf() failure case 2020-01-27 14:50:21 +01:00
kcs_bmc.h ipmi: kcs_bmc: coding-style fixes and use new poll type 2018-02-26 09:49:21 -06:00
kcs_bmc_aspeed.c ipmi: kcs_bmc: coding-style fixes and use new poll type 2018-02-26 09:49:21 -06:00
kcs_bmc_npcm7xx.c ipmi: NPCM7xx KCS BMC: enable interrupt to the host 2018-05-23 08:29:23 -05:00
Makefile ipmi: add an NPCM7xx KCS BMC driver 2018-04-18 10:23:12 -05:00