mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-01 06:46:35 +01:00
zram: free secondary algorithms names
We need to kfree() secondary algorithms names when reset zram device that
had multi-streams, otherwise we leak memory.
[[email protected]: kfree(NULL) is legal]
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 001d927357 ("zram: add recompression algorithm sysfs knob")
Signed-off-by: Sergey Senozhatsky <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
This commit is contained in:
1 parent
2abbcc099e
commit
684826f827
1 file changed
+5
@@ -2112,6 +2112,11 @@ static void zram_destroy_comps(struct zram *zram)
|
||||
zram->num_active_comps--;
|
||||
}
|
||||
|
||||
for (prio = ZRAM_SECONDARY_COMP; prio < ZRAM_MAX_COMPS; prio++) {
|
||||
kfree(zram->comp_algs[prio]);
|
||||
zram->comp_algs[prio] = NULL;
|
||||
}
|
||||
|
||||
zram_comp_params_reset(zram);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user