]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
fs: fat: get_contents() always returns -1 for errors
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 12 Sep 2019 17:19:30 +0000 (19:19 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 11 Oct 2019 23:05:14 +0000 (19:05 -0400)
If out of memory, return -1 and not -ENOMEM from get_contents().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
fs/fat/fat.c

index 2a5300d5019f7e8346ee949df4e5bc2450977826..9e1b842dac6b9802960b19bb180a90e894679159 100644 (file)
@@ -364,7 +364,7 @@ static int get_contents(fsdata *mydata, dir_entry *dentptr, loff_t pos,
                tmp_buffer = malloc_cache_aligned(actsize);
                if (!tmp_buffer) {
                        debug("Error: allocating buffer\n");
-                       return -ENOMEM;
+                       return -1;
                }
 
                if (get_cluster(mydata, curclust, tmp_buffer, actsize) != 0) {