Skip to contentSkip to conversation

Drivers: hv: utils: fix hvt_op_poll() return value on transport destroy

PATCH New Vitaly Kuznetsov 1 participant 1 message Dec 15, 2015 Hyper-V/Azure core and drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Drivers: hv: utils: fix hvt_op_poll() return value on transport destroy

The return type of hvt_op_poll() is unsigned int and -EBADF is inappropriate, poll functions return POLL* statuses.

---
- This is a follow-up to the previously sent 'Drivers: hv: utils: introduce HVUTIL_TRANSPORT_DESTROY mode' patch which is already in char-misc-testing tree (a15025660d47).

---
 drivers/hv/hv_utils_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hv/hv_utils_transport.c +1 -1
index ee20b50..4f42c0e 100644
@@ -109,7 +109,7 @@ static unsigned int hvt_op_poll(struct file *file, poll_table *wait)
 	poll_wait(file, &hvt->outmsg_q, wait);
 
 	if (hvt->mode == HVUTIL_TRANSPORT_DESTROY)
-		return -EBADF;
+		return POLLERR | POLLHUP;
 
 	if (hvt->outmsg_len > 0)
 		return POLLIN | POLLRDNORM;
Signature · 1 line
2.4.3