Commit ccfa313
dmaengine: fsl-edma: implement the cleanup path of fsl_edma3_attach_pd()
Current implementation of fsl_edma3_attach_pd() does not provide a
cleanup path, resulting in a memory leak. For example,
dev_pm_domain_detach() is not called after dev_pm_domain_attach_by_id(),
and the device link created with the DL_FLAG_STATELESS is not released
explicitly.
Therefore, provide a cleanup function fsl_edma3_detach_pd() and call it
upon failure. Also add a devm_add_action_or_reset() call with this
function after a successful fsl_edma3_attach_pd().
Fixes: 72f5801 ("dmaengine: fsl-edma: integrate v3 support")
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Link: https://lore.kernel.org/r/20241221075712.3297200-1-joe@pf.is.s.u-tokyo.ac.jp
Signed-off-by: Vinod Koul <vkoul@kernel.org>1 parent dcbef07 commit ccfa313
2 files changed
+37
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
420 | 444 | | |
421 | 445 | | |
422 | 446 | | |
423 | | - | |
424 | 447 | | |
425 | 448 | | |
426 | 449 | | |
| |||
436 | 459 | | |
437 | 460 | | |
438 | 461 | | |
439 | | - | |
| 462 | + | |
440 | 463 | | |
441 | 464 | | |
442 | | - | |
| 465 | + | |
443 | 466 | | |
444 | 467 | | |
445 | | - | |
| 468 | + | |
446 | 469 | | |
447 | | - | |
| 470 | + | |
| 471 | + | |
448 | 472 | | |
449 | 473 | | |
450 | 474 | | |
| |||
455 | 479 | | |
456 | 480 | | |
457 | 481 | | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
458 | 486 | | |
459 | 487 | | |
460 | 488 | | |
| |||
544 | 572 | | |
545 | 573 | | |
546 | 574 | | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
547 | 578 | | |
548 | 579 | | |
549 | 580 | | |
| |||
0 commit comments