Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'hyperv-fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux

Pull Hyper-V fixes from Sasha Levin:
"Two fixes from Dexuan Cui:

- Fix a (harmless) warning when building vmbus without
CONFIG_PM_SLEEP

- Fix for a memory leak (and optimization) in the hyperv mouse code"

* tag 'hyperv-fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
Drivers: hv: vmbus: Fix harmless building warnings without CONFIG_PM_SLEEP
HID: hyperv: Use in-place iterator API in the channel callback

+16 -46
+10 -46
drivers/hid/hid-hyperv.c
··· 314 314 315 315 static void mousevsc_on_channel_callback(void *context) 316 316 { 317 - const int packet_size = 0x100; 318 - int ret; 319 317 struct hv_device *device = context; 320 - u32 bytes_recvd; 321 - u64 req_id; 322 318 struct vmpacket_descriptor *desc; 323 - unsigned char *buffer; 324 - int bufferlen = packet_size; 325 319 326 - buffer = kmalloc(bufferlen, GFP_ATOMIC); 327 - if (!buffer) 328 - return; 329 - 330 - do { 331 - ret = vmbus_recvpacket_raw(device->channel, buffer, 332 - bufferlen, &bytes_recvd, &req_id); 333 - 334 - switch (ret) { 335 - case 0: 336 - if (bytes_recvd <= 0) { 337 - kfree(buffer); 338 - return; 339 - } 340 - desc = (struct vmpacket_descriptor *)buffer; 341 - 342 - switch (desc->type) { 343 - case VM_PKT_COMP: 344 - break; 345 - 346 - case VM_PKT_DATA_INBAND: 347 - mousevsc_on_receive(device, desc); 348 - break; 349 - 350 - default: 351 - pr_err("unhandled packet type %d, tid %llx len %d\n", 352 - desc->type, req_id, bytes_recvd); 353 - break; 354 - } 355 - 320 + foreach_vmbus_pkt(desc, device->channel) { 321 + switch (desc->type) { 322 + case VM_PKT_COMP: 356 323 break; 357 324 358 - case -ENOBUFS: 359 - kfree(buffer); 360 - /* Handle large packet */ 361 - bufferlen = bytes_recvd; 362 - buffer = kmalloc(bytes_recvd, GFP_ATOMIC); 325 + case VM_PKT_DATA_INBAND: 326 + mousevsc_on_receive(device, desc); 327 + break; 363 328 364 - if (!buffer) 365 - return; 366 - 329 + default: 330 + pr_err("Unhandled packet type %d, tid %llx len %d\n", 331 + desc->type, desc->trans_id, desc->len8 * 8); 367 332 break; 368 333 } 369 - } while (1); 370 - 334 + } 371 335 } 372 336 373 337 static int mousevsc_connect_to_vsp(struct hv_device *device)
+6
drivers/hv/vmbus_drv.c
··· 912 912 drv->shutdown(dev); 913 913 } 914 914 915 + #ifdef CONFIG_PM_SLEEP 915 916 /* 916 917 * vmbus_suspend - Suspend a vmbus device 917 918 */ ··· 950 949 951 950 return drv->resume(dev); 952 951 } 952 + #endif /* CONFIG_PM_SLEEP */ 953 953 954 954 /* 955 955 * vmbus_device_release - Final callback release of the vmbus child device ··· 1072 1070 vmbus_signal_eom(msg, message_type); 1073 1071 } 1074 1072 1073 + #ifdef CONFIG_PM_SLEEP 1075 1074 /* 1076 1075 * Fake RESCIND_CHANNEL messages to clean up hv_sock channels by force for 1077 1076 * hibernation, because hv_sock connections can not persist across hibernation. ··· 1108 1105 vmbus_connection.work_queue, 1109 1106 &ctx->work); 1110 1107 } 1108 + #endif /* CONFIG_PM_SLEEP */ 1111 1109 1112 1110 /* 1113 1111 * Direct callback for channels using other deferred processing ··· 2129 2125 return ret_val; 2130 2126 } 2131 2127 2128 + #ifdef CONFIG_PM_SLEEP 2132 2129 static int vmbus_bus_suspend(struct device *dev) 2133 2130 { 2134 2131 struct vmbus_channel *channel, *sc; ··· 2252 2247 2253 2248 return 0; 2254 2249 } 2250 + #endif /* CONFIG_PM_SLEEP */ 2255 2251 2256 2252 static const struct acpi_device_id vmbus_acpi_device_ids[] = { 2257 2253 {"VMBUS", 0},