Commit 5101645
Drivers: hv: Free msginfo when the buffer fails to decrypt
The early failure path in __vmbus_establish_gpadl() doesn't deallocate
msginfo if the buffer fails to decrypt.
Fix the leak by breaking out the cleanup code into a separate function
and calling it where required.
Fixes: d4dccf3 ("Drivers: hv: vmbus: Mark vmbus ring buffer visible to host in Isolation VM")
Reported-by: Michael Kelley <mkhlinux@outlook.com>
Closes: https://lore.kernel.org/linux-hyperv/SN6PR02MB41573796F9787F67E0E97049D472A@SN6PR02MB4157.namprd02.prod.outlook.com
Signed-off-by: Roman Kisel <romank@linux.microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>1 parent 0a4534b commit 5101645
1 file changed
Lines changed: 18 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
413 | 428 | | |
414 | 429 | | |
415 | 430 | | |
| |||
429 | 444 | | |
430 | 445 | | |
431 | 446 | | |
432 | | - | |
| 447 | + | |
433 | 448 | | |
434 | 449 | | |
435 | 450 | | |
| |||
459 | 474 | | |
460 | 475 | | |
461 | 476 | | |
| 477 | + | |
462 | 478 | | |
463 | 479 | | |
464 | 480 | | |
| |||
535 | 551 | | |
536 | 552 | | |
537 | 553 | | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | 554 | | |
543 | | - | |
| 555 | + | |
544 | 556 | | |
545 | 557 | | |
546 | 558 | | |
| |||
0 commit comments