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

Commit 2503a05f authored by Pratap Nirujogi's avatar Pratap Nirujogi Committed by Gerrit - the friendly Code Review server
Browse files

ion: ensure valid start address



Ensure valid start address to check for vaddress
bounds.

Change-Id: I02c0ce85d9a495880c133e66553b09159daa8f0c
Signed-off-by: default avatarPratap Nirujogi <pratapn@codeaurora.org>
parent 0d8bfae5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2018, 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
@@ -745,7 +745,7 @@ long msm_ion_custom_ioctl(struct ion_client *client,
			data.flush_data.offset;
		end = start + data.flush_data.length;

		if (check_vaddr_bounds(start, end)) {
		if (start && check_vaddr_bounds(start, end)) {
			pr_err("%s: virtual address %pK is out of bounds\n",
			       __func__, data.flush_data.vaddr);
			ret = -EINVAL;