]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
coverity: debugfs devfip remove comparisons to LONG_MAX
authorOlivier Deprez <olivier.deprez@arm.com>
Mon, 6 Jan 2020 14:45:22 +0000 (15:45 +0100)
committerOlivier Deprez <olivier.deprez@arm.com>
Tue, 4 Feb 2020 13:40:30 +0000 (13:40 +0000)
CID 353228:  Integer handling issues  (CONSTANT_EXPRESSION_RESULT)

The checks on size and offset_address in get_entry always resolve to
false provided those fields are long long int and cannot be greater
than LONG_MAX.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I0fac485a39ac4a40ae8c0d25a706ad74c795e130

lib/debugfs/devfip.c

index 5581b219fa0a6b960f6fdd0acddb116f03adecf4..fc14e707ec9c71f959f9a0a6b7f0672ba6e43db8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -103,10 +103,6 @@ static int get_entry(chan_t *c, struct fip_entry *entry)
                return -1;
        }
 
-       if ((entry->size > LONG_MAX) || (entry->offset_address > LONG_MAX)) {
-               return -1;
-       }
-
        if (entry->size == 0) {
                return 0;
        }