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

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

Merge "msm: mdss: validate the buffer size before allocating memory"

parents a645a585 35e83e80
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -758,6 +758,11 @@ static ssize_t mdss_dsi_cmd_state_write(struct file *file,
	int *link_state = file->private_data;
	char *input;

	if (!count) {
		pr_err("%s: Zero bytes to be written\n", __func__);
		return -EINVAL;
	}

	input = kmalloc(count, GFP_KERNEL);
	if (!input) {
		pr_err("%s: Failed to allocate memory\n", __func__);