Commit a988617
committed
platform/x86/amd: pmf: Use device managed allocations
JIRA: https://issues.redhat.com/browse/RHEL-104142
commit d9db3a9
Author: Mario Limonciello <mario.limonciello@amd.com>
Date: Wed May 21 19:34:55 2025 -0500
platform/x86/amd: pmf: Use device managed allocations
If setting up smart PC fails for any reason then this can lead to
a double free when unloading amd-pmf. This is because dev->buf was
freed but never set to NULL and is again freed in amd_pmf_remove().
To avoid subtle allocation bugs in failures leading to a double free
change all allocations into device managed allocations.
Fixes: 5b1122f ("platform/x86/amd/pmf: fix cleanup in amd_pmf_init_smart_pc()")
Link: https://lore.kernel.org/r/20250512211154.2510397-2-superm1@kernel.org
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20250522003457.1516679-2-superm1@kernel.org
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Steve Best <sbest@redhat.com>1 parent f276f2f commit a988617
2 files changed
+22
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
496 | | - | |
497 | 496 | | |
498 | 497 | | |
499 | 498 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
362 | | - | |
363 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
364 | 369 | | |
365 | | - | |
| 370 | + | |
366 | 371 | | |
367 | 372 | | |
368 | 373 | | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
| 374 | + | |
| 375 | + | |
373 | 376 | | |
374 | 377 | | |
375 | 378 | | |
376 | 379 | | |
377 | | - | |
| 380 | + | |
378 | 381 | | |
379 | 382 | | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | 383 | | |
386 | 384 | | |
387 | 385 | | |
| |||
532 | 530 | | |
533 | 531 | | |
534 | 532 | | |
535 | | - | |
| 533 | + | |
536 | 534 | | |
537 | 535 | | |
538 | | - | |
| 536 | + | |
539 | 537 | | |
540 | 538 | | |
541 | | - | |
| 539 | + | |
542 | 540 | | |
543 | 541 | | |
544 | 542 | | |
545 | 543 | | |
546 | 544 | | |
547 | 545 | | |
548 | 546 | | |
549 | | - | |
| 547 | + | |
550 | 548 | | |
551 | 549 | | |
552 | 550 | | |
553 | 551 | | |
554 | | - | |
| 552 | + | |
555 | 553 | | |
556 | 554 | | |
557 | | - | |
| 555 | + | |
558 | 556 | | |
559 | 557 | | |
560 | 558 | | |
561 | 559 | | |
562 | 560 | | |
563 | | - | |
| 561 | + | |
564 | 562 | | |
565 | 563 | | |
566 | 564 | | |
| |||
575 | 573 | | |
576 | 574 | | |
577 | 575 | | |
578 | | - | |
| 576 | + | |
579 | 577 | | |
580 | 578 | | |
581 | 579 | | |
| |||
584 | 582 | | |
585 | 583 | | |
586 | 584 | | |
587 | | - | |
| 585 | + | |
588 | 586 | | |
589 | 587 | | |
590 | 588 | | |
| |||
600 | 598 | | |
601 | 599 | | |
602 | 600 | | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | 601 | | |
610 | 602 | | |
611 | 603 | | |
| |||
621 | 613 | | |
622 | 614 | | |
623 | 615 | | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | 616 | | |
631 | 617 | | |
0 commit comments