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

Commit 504cc773 authored by Hareesh Gundu's avatar Hareesh Gundu
Browse files

msm: kgsl: Fix use of uninitialized memory



Use kzalloc() to avoid uninitialized buffer reading
in profile_assignments_read(). This will fix use of
uninitialized memory in case if it is not enter into
loop to fill the buffer in profile_assignments_read().

Change-Id: Ib0b78564c2ec4298e6938ec76d031106469e16ef
Signed-off-by: default avatarHareesh Gundu <hareeshg@codeaurora.org>
parent 7eaf07a0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -523,7 +523,7 @@ static ssize_t profile_assignments_read(struct file *filep,
		return 0;
	}

	buf = kmalloc(max_size, GFP_KERNEL);
	buf = kzalloc(max_size, GFP_KERNEL);
	if (!buf) {
		mutex_unlock(&device->mutex);
		return -ENOMEM;