linux_dsm_epyc7002/drivers/misc/cxl
Vaibhav Jain ef6cb5f1a0 cxl: Fix wrong comparison in cxl_adapter_context_get()
Function atomic_inc_unless_negative() returns a bool to indicate
success/failure. However cxl_adapter_context_get() wrongly compares
the return value against '>=0' which will always be true. The patch
fixes this comparison to '==0' there by also fixing this compile time
warning:

	drivers/misc/cxl/main.c:290 cxl_adapter_context_get()
	warn: 'atomic_inc_unless_negative(&adapter->contexts_num)' is unsigned

Fixes: 70b565bbdb ("cxl: Prevent adapter reset if an active context exists")
Cc: stable@vger.kernel.org # v4.9+
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2018-07-19 21:58:11 +10:00
..
api.c Revert "cxl: Add kernel APIs to get & set the max irqs per context" 2018-07-02 23:54:31 +10:00
base.c Revert "cxl: Allow a default context to be associated with an external pci_dev" 2018-07-02 23:54:33 +10:00
context.c cxl: Remove abandonned capi support for the Mellanox CX4, final cleanup 2018-07-02 23:54:33 +10:00
cxl.h Merge branch 'topic/ppc-kvm' into next 2018-07-19 14:37:57 +10:00
cxllib.c powerpc/64s: Remove POWER9 DD1 support 2018-07-16 11:37:21 +10:00
debugfs.c cxl: Remove abandonned capi support for the Mellanox CX4, final cleanup 2018-07-02 23:54:33 +10:00
fault.c cxl: Add support for POWER9 DD2 2017-10-06 20:52:43 +11:00
file.c vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
flash.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
guest.c Revert "cxl: Add kernel API to allow a context to operate with relocate disabled" 2018-07-02 23:54:30 +10:00
hcalls.c cxl: Remove unused values in bare-metal environment. 2017-04-13 23:34:28 +10:00
hcalls.h cxl: Add guest-specific code 2016-03-09 23:36:52 +11:00
irq.c cxl: Add psl9 specific code 2017-04-13 23:34:31 +10:00
Kconfig Revert "cxl: Add cxl_check_and_switch_mode() API to switch bi-modal cards" 2018-07-02 23:54:31 +10:00
main.c cxl: Fix wrong comparison in cxl_adapter_context_get() 2018-07-19 21:58:11 +10:00
Makefile Revert "cxl: Allow a default context to be associated with an external pci_dev" 2018-07-02 23:54:33 +10:00
native.c Revert "cxl: Add kernel API to allow a context to operate with relocate disabled" 2018-07-02 23:54:30 +10:00
of.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
pci.c Merge branch 'topic/ppc-kvm' into next 2018-07-19 14:37:57 +10:00
sysfs.c Merge branch 'fixes' into next 2018-06-03 20:32:02 +10:00
trace.c cxl: Add tracepoints 2015-01-22 17:31:51 +11:00
trace.h cxl: Add psl9 specific code 2017-04-13 23:34:31 +10:00
vphb.c Revert "cxl: Allow a default context to be associated with an external pci_dev" 2018-07-02 23:54:33 +10:00