Commit e383531
ASoC: mediatek: mt8196: Fix probe resource cleanup
The MT8196 AFE probe assigns reserved memory with
of_reserved_mem_device_init(), but never releases it.
This leaks the reserved memory assignment on driver
removal and on later probe failures.
The same probe path also uses unchecked pm_runtime_get_sync() calls.
A failure while resuming the device can leave the runtime PM usage
count in an unexpected state.
The regmap error path returns directly while the device is still
runtime active, and the remove path drops a runtime PM reference even
though successful probe has already released its temporary reference.
Register a devm cleanup action for the reserved memory assignment,
use pm_runtime_resume_and_get(), and only drop runtime PM references
on paths where they are actually held.
Fixes: 57513aa ("ASoC: mediatek: mt8196: add platform driver")
Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Link: https://patch.msgid.link/20260517-asoc-mt8196-probe-cleanup-v1-1-a5d26949d7fe@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>1 parent e001484 commit e383531
1 file changed
Lines changed: 30 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2242 | 2242 | | |
2243 | 2243 | | |
2244 | 2244 | | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
2245 | 2254 | | |
2246 | | - | |
2247 | | - | |
2248 | | - | |
2249 | | - | |
2250 | | - | |
2251 | | - | |
2252 | 2255 | | |
2253 | 2256 | | |
2254 | 2257 | | |
| |||
2306 | 2309 | | |
2307 | 2310 | | |
2308 | 2311 | | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
2309 | 2317 | | |
2310 | 2318 | | |
2311 | 2319 | | |
| |||
2320 | 2328 | | |
2321 | 2329 | | |
2322 | 2330 | | |
2323 | | - | |
| 2331 | + | |
2324 | 2332 | | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + | |
| 2336 | + | |
| 2337 | + | |
2325 | 2338 | | |
2326 | 2339 | | |
2327 | 2340 | | |
| |||
2422 | 2435 | | |
2423 | 2436 | | |
2424 | 2437 | | |
2425 | | - | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
2426 | 2441 | | |
2427 | 2442 | | |
2428 | 2443 | | |
2429 | | - | |
2430 | | - | |
| 2444 | + | |
| 2445 | + | |
| 2446 | + | |
| 2447 | + | |
2431 | 2448 | | |
2432 | 2449 | | |
2433 | 2450 | | |
2434 | 2451 | | |
2435 | 2452 | | |
2436 | | - | |
| 2453 | + | |
2437 | 2454 | | |
2438 | 2455 | | |
2439 | 2456 | | |
| |||
2452 | 2469 | | |
2453 | 2470 | | |
2454 | 2471 | | |
2455 | | - | |
| 2472 | + | |
2456 | 2473 | | |
2457 | 2474 | | |
2458 | 2475 | | |
2459 | 2476 | | |
2460 | | - | |
| 2477 | + | |
2461 | 2478 | | |
2462 | 2479 | | |
2463 | 2480 | | |
| |||
2467 | 2484 | | |
2468 | 2485 | | |
2469 | 2486 | | |
2470 | | - | |
2471 | 2487 | | |
2472 | 2488 | | |
2473 | 2489 | | |
| |||
0 commit comments