]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
io_fip: return -ENFILE when a file is already open
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 9 Jul 2020 14:05:45 +0000 (23:05 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Sat, 11 Jul 2020 06:24:13 +0000 (15:24 +0900)
The cause of failure is not memory shortage.

The comment for ENFILE in include/lib/libc/errno.h

  /* Too many open files in system */

... is a better match to the warning message here.

Change-Id: I45a1740995d464edd8b3e32b93f1f92ba17e5874
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
drivers/io/io_fip.c

index 02f85d603cb07e3c1029feb766a9a8ebd862c116..7aa717da867e303a924640f4323bbc2309ac5496 100644 (file)
@@ -302,7 +302,7 @@ static int fip_file_open(io_dev_info_t *dev_info, const uintptr_t spec,
         */
        if (current_file.entry.offset_address != 0) {
                WARN("fip_file_open : Only one open file at a time.\n");
-               return -ENOMEM;
+               return -ENFILE;
        }
 
        /* Attempt to access the FIP image */