aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.14/950-0154-vcsm-Fix-obscure-conditions-again.patch
blob: fa2f18cae490a556d1d2346aa31f2df22e5219e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From e573dde8103d381a65acfd2be3964b0d1ba93932 Mon Sep 17 00:00:00 2001
From: Sugizaki Yukimasa <i.can.speak.c.and.basic@gmail.com>
Date: Tue, 9 Jan 2018 12:33:24 +0900
Subject: [PATCH 154/454] vcsm: Fix obscure conditions again

Signed-off-by: Sugizaki Yukimasa <i.can.speak.c.and.basic@gmail.com>
---
 drivers/char/broadcom/vc_sm/vmcs_sm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/char/broadcom/vc_sm/vmcs_sm.c
+++ b/drivers/char/broadcom/vc_sm/vmcs_sm.c
@@ -331,8 +331,8 @@ static unsigned int vmcs_sm_usr_handle_f
 		list_for_each_entry(map, &sm_state->map_list, map_list) {
 			if (map->res_pid != pid)
 				continue;
-			if (!(map->res_addr <= addr &&
-						addr < map->res_addr + map->resource->res_size))
+			if (addr < map->res_addr ||
+						addr >= (map->res_addr + map->resource->res_size))
 				continue;
 
 			pr_debug("[%s]: global map %p (pid %u, addr %lx) -> usr-hdl %x (vc-hdl %x)\n",