Unverified Commit e53a23ef authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14323 zram: fix NULL pointer in comp_algorithm_show()

parents 16a0cbac ad4dd6e8
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -2218,6 +2218,7 @@ static int zram_add(void)
	zram->disk->fops = &zram_devops;
	zram->disk->private_data = zram;
	snprintf(zram->disk->disk_name, 16, "zram%d", device_id);
	comp_algorithm_set(zram, ZRAM_PRIMARY_COMP, default_compressor);

	/* Actual capacity set using sysfs (/sys/block/zram<id>/disksize */
	set_capacity(zram->disk, 0);
@@ -2253,8 +2254,6 @@ static int zram_add(void)
	if (ret)
		goto out_cleanup_disk;

	comp_algorithm_set(zram, ZRAM_PRIMARY_COMP, default_compressor);

	zram_debugfs_register(zram);
	pr_info("Added device: %s\n", zram->disk->disk_name);
	return device_id;