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

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

Merge "disp: msm: sde: add check before buffer copy"

parents 2eab02cb 4a35a49f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1540,6 +1540,9 @@ static ssize_t _sde_debugfs_conn_cmd_tx_sts_read(struct file *file,
		return 0;
	}

	if (blen > count)
		blen = count;

	if (copy_to_user(buf, buffer, blen)) {
		SDE_ERROR("copy to user buffer failed\n");
		return -EFAULT;
+7 −1
Original line number Diff line number Diff line
/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2019, 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
@@ -1044,6 +1044,9 @@ static ssize_t _sde_debugfs_mode_ctrl_read(struct file *file, char __user *buf,
	if (blen <= 0)
		return 0;

	if (blen > count)
		blen = count;

	if (copy_to_user(buf, buffer, blen))
		return -EFAULT;

@@ -1136,6 +1139,9 @@ static ssize_t _sde_debugfs_vsync_mode_read(struct file *file, char __user *buf,
	if (blen <= 0)
		return 0;

	if (blen > count)
		blen = count;

	if (copy_to_user(buf, buffer, blen))
		return -EFAULT;