diff options
| author | Vaibhav Jain <[email protected]> | 2018-07-04 20:58:33 +0530 |
|---|---|---|
| committer | Michael Ellerman <[email protected]> | 2018-07-19 21:58:11 +1000 |
| commit | ef6cb5f1a048fdf91ccee6d63d2bfa293338502d (patch) | |
| tree | 8723504eb84b7bd7724dc77e3bf7381adb7b7d4c /tools | |
| parent | 99c3ce33a00bc40cb218af770ef00c82c8044c36 (diff) | |
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: 70b565bbdb91 ("cxl: Prevent adapter reset if an active context exists")
Cc: [email protected] # v4.9+
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Vaibhav Jain <[email protected]>
Acked-by: Andrew Donnellan <[email protected]>
Acked-by: Frederic Barrat <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions