Skip to content

Commit 11a1d6d

Browse files
author
CKI KWF Bot
committed
Merge: zram: fix NULL pointer in comp_algorithm_show()
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/879 zram: fix NULL pointer in comp_algorithm_show() JIRA: https://issues.redhat.com/browse/RHEL-77764 CVE: CVE-2024-53222 Signed-off-by: Ming Lei <ming.lei@redhat.com> Approved-by: Maurizio Lombardi <mlombard@redhat.com> Approved-by: Chris Leech <cleech@redhat.com> Approved-by: Jeff Moyer <jmoyer@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents e43020f + b9ea17b commit 11a1d6d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/block/zram/zram_drv.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2382,15 +2382,15 @@ static int zram_add(void)
23822382
zram->disk->private_data = zram;
23832383
snprintf(zram->disk->disk_name, 16, "zram%d", device_id);
23842384

2385+
zram_comp_params_reset(zram);
2386+
comp_algorithm_set(zram, ZRAM_PRIMARY_COMP, default_compressor);
2387+
23852388
/* Actual capacity set using sysfs (/sys/block/zram<id>/disksize */
23862389
set_capacity(zram->disk, 0);
23872390
ret = device_add_disk(NULL, zram->disk, zram_disk_groups);
23882391
if (ret)
23892392
goto out_cleanup_disk;
23902393

2391-
zram_comp_params_reset(zram);
2392-
comp_algorithm_set(zram, ZRAM_PRIMARY_COMP, default_compressor);
2393-
23942394
zram_debugfs_register(zram);
23952395
pr_info("Added device: %s\n", zram->disk->disk_name);
23962396
return device_id;

0 commit comments

Comments
 (0)