blob: 3c4f1dc454efe2743e081da0386c86186d07b9cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
From 92b27d4017371772d0370d1e60a32a9f22224c81 Mon Sep 17 00:00:00 2001
From: Sugizaki Yukimasa <i.can.speak.c.and.basic@gmail.com>
Date: Mon, 8 Jan 2018 21:07:17 +0900
Subject: [PATCH 151/454] vcsm: Fix obscure conditions
Signed-off-by: Sugizaki Yukimasa <i.can.speak.c.and.basic@gmail.com>
---
drivers/char/broadcom/vc_sm/vmcs_sm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/drivers/char/broadcom/vc_sm/vmcs_sm.c
+++ b/drivers/char/broadcom/vc_sm/vmcs_sm.c
@@ -278,8 +278,8 @@ static unsigned int vmcs_sm_vc_handle_fr
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) -> vc-hdl %x (usr-hdl %x)\n",
@@ -1263,7 +1263,7 @@ static int clean_invalid_mem_2d(const vo
size_t i;
void (*op_fn)(const void*, const void*);
- if (block_size <= 0) {
+ if (!block_size) {
pr_err("[%s]: size cannot be 0\n", __func__);
return -EINVAL;
}
|