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

Commit 04ad73a4 authored by ckosuru's avatar ckosuru
Browse files

Merge remote-tracking branch 'quic/dev/msm-4.14.c12-display' into msm-4.14.c12



* quic/dev/msm-4.14.c12-display:
  disp: msm: add check for buffer length before copy

Change-Id: I56dff98f2abd289acc4aae0f6c05bb5998f2c834
Signed-off-by: default avatarckosuru <kosuru@codeaurora.org>
parents 7283a275 ab7ff284
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -119,6 +119,9 @@ static ssize_t debugfs_state_info_read(struct file *file,
			dsi_ctrl->clk_freq.pix_clk_rate,
			dsi_ctrl->clk_freq.esc_clk_rate);

	if (len > count)
		len = count;

	len = min_t(size_t, len, SZ_4K);
	if (copy_to_user(buff, buf, len)) {
		kfree(buf);
@@ -174,6 +177,9 @@ static ssize_t debugfs_reg_dump_read(struct file *file,
		return rc;
	}

	if (len > count)
		len = count;

	len = min_t(size_t, len, SZ_4K);
	if (copy_to_user(buff, buf, len)) {
		kfree(buf);