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

Commit 6496a9a2 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "soc: qcom: dcc: avoid memory access violation"

parents c0fcbd0d 0543cd39
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1558,7 +1558,8 @@ static ssize_t dcc_sram_read(struct file *file, char __user *data,
	if (drvdata->ram_size <= *ppos)
		return 0;

	if ((*ppos + len) > drvdata->ram_size)
	if ((*ppos + len) < len
		|| (*ppos + len) > drvdata->ram_size)
		len = (drvdata->ram_size - *ppos);

	buf = kzalloc(len, GFP_KERNEL);