Commit 74363ec
zram: fix uninitialized ZRAM not releasing backing device
Setting backing device is done before ZRAM initialization. If we set the
backing device, then remove the ZRAM module without initializing the
device, the backing device reference will be leaked and the device will be
hold forever.
Fix this by always reset the ZRAM fully on rmmod or reset store.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 013bf95 ("zram: add interface to specif backing device")
Signed-off-by: Kairui Song <[email protected]>
Reported-by: Desheng Wu <[email protected]>
Suggested-by: Sergey Senozhatsky <[email protected]>
Reviewed-by: Sergey Senozhatsky <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>1 parent be48c41 commit 74363ec
1 file changed
+4
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1444 | 1444 | | |
1445 | 1445 | | |
1446 | 1446 | | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
1447 | 1450 | | |
1448 | 1451 | | |
1449 | 1452 | | |
1450 | 1453 | | |
1451 | 1454 | | |
1452 | 1455 | | |
| 1456 | + | |
1453 | 1457 | | |
1454 | 1458 | | |
1455 | 1459 | | |
| |||
2326 | 2330 | | |
2327 | 2331 | | |
2328 | 2332 | | |
2329 | | - | |
2330 | | - | |
2331 | | - | |
2332 | | - | |
2333 | | - | |
2334 | 2333 | | |
2335 | 2334 | | |
2336 | 2335 | | |
| |||
0 commit comments