Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20aaef19 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "zram: protect sysfs handler from invalid memory access"

parents 22b0bd6e 2579c718
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -188,8 +188,10 @@ static ssize_t mem_used_total_show(struct device *dev,
	struct zram *zram = dev_to_zram(dev);
	struct zram_meta *meta = zram->meta;

	down_read(&zram->init_lock);
	if (zram->init_done)
		val = zs_get_total_size_bytes(meta->mem_pool);
	up_read(&zram->init_lock);

	return sprintf(buf, "%llu\n", val);
}