linux_dsm_epyc7002/drivers/hv
Kimberly Brown fcedbb293e Drivers: hv: vmbus: Refactor chan->state if statement
The chan->state "if statement" was introduced in commit 6712cc9c22
("vmbus: don't return values for uninitalized channels"). That commit
states that the purpose of the chan->state "if statement" is to prevent
returning garbage or causing a kernel OOPS when the channel ring buffer
is not initialized. The changes in this patch provide the same
protection.

Refactor the chan->state “if statement” in vmbus_chan_attr_show():
 - Instead of checking the channel state in the "if statement", check
   whether the channel ring buffer pointer is NULL. Checking the
   ring buffer pointer makes this code consistent with
   hv_ringbuffer_get_debuginfo().

 - Move the "if statement" to the four "_show" functions that access a
   channel ring buffer. Only four of the channel-level "_show" functions
   access a ring buffer. The ring buffer pointer does not need to be
   checked before calling the other "_show" functions, and moving the
   ring buffer pointer "if statement" to the "_show" functions that
   access a ring buffer makes the purpose of the "if statement" clear.

Signed-off-by: Kimberly Brown <kimbrownkd@gmail.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-04-10 18:58:56 -04:00
..
channel_mgmt.c Drivers: hv: vmbus: Expose monitor data only when monitor pages are used 2019-03-20 23:55:56 -04:00
channel.c vmbus: Switch to use new generic UUID API 2019-02-14 20:45:23 -05:00
connection.c Drivers: hv: vmbus: Offload the handling of channels to two workqueues 2018-12-03 08:01:01 +01:00
hv_balloon.c hv_balloon: mark inflated pages PG_offline 2019-03-05 21:07:14 -08:00
hv_fcopy.c Drivers: hv: fcopy: restore correct transfer length 2017-09-22 10:29:54 +02:00
hv_kvp.c Merge 4.20-rc4 into char-misc-next 2018-11-26 07:50:56 +01:00
hv_snapshot.c Merge 4.11-rc4 into char-misc-next 2017-03-27 09:13:04 +02:00
hv_trace_balloon.h hv_balloon: trace post_status 2018-03-06 09:57:17 -08:00
hv_trace.c hv: add SPDX license to trace 2018-03-28 13:24:56 +02:00
hv_trace.h hv: add SPDX license to trace 2018-03-28 13:24:56 +02:00
hv_util.c hv_utils: update name in struct hv_driver util_drv 2018-11-11 12:58:26 -08:00
hv_utils_transport.c vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
hv_utils_transport.h Drivers: hv: util: move waiting for release to hv_utils_transport itself 2017-03-16 16:42:00 +09:00
hv.c Char/Misc driver patches for 4.21-rc1 2018-12-28 20:54:57 -08:00
hyperv_vmbus.h Drivers: hv: vmbus: Expose monitor data only when monitor pages are used 2019-03-20 23:55:56 -04:00
Kconfig x86, hyperv: remove PCI dependency 2018-12-13 14:55:57 -05:00
Makefile hv_balloon: trace post_status 2018-03-06 09:57:17 -08:00
ring_buffer.c Drivers: hv: vmbus: Expose counters for interrupts and full conditions 2019-02-14 20:56:10 -05:00
vmbus_drv.c Drivers: hv: vmbus: Refactor chan->state if statement 2019-04-10 18:58:56 -04:00