From 2503a05f0df4e1cea563de138c1f227941a3206d Mon Sep 17 00:00:00 2001 From: Pratap Nirujogi Date: Sun, 18 Mar 2018 17:46:33 +0530 Subject: ion: ensure valid start address Ensure valid start address to check for vaddress bounds. Change-Id: I02c0ce85d9a495880c133e66553b09159daa8f0c Signed-off-by: Pratap Nirujogi --- drivers/staging/android/ion/msm/msm_ion.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/android/ion/msm/msm_ion.c b/drivers/staging/android/ion/msm/msm_ion.c index 989d336c0648..7326aa46a8f6 100644 --- a/drivers/staging/android/ion/msm/msm_ion.c +++ b/drivers/staging/android/ion/msm/msm_ion.c @@ -1,4 +1,4 @@ -/* 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; -- cgit v1.2.3