diff mbox series

[U-Boot,2/2] fs: fat: get_contents() always returns -1 for errors

Message ID 20190912171930.17163-3-xypron.glpk@gmx.de
State Accepted, archived
Commit f13683816b9d0aada2546343d77bb87925505c46
Delegated to: Tom Rini
Headers show
Series fs: fat: error handling in get_contents() | expand

Commit Message

Heinrich Schuchardt Sept. 12, 2019, 5:19 p.m. UTC
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.23.0

Comments

Tom Rini Oct. 12, 2019, 8:28 p.m. UTC | #1
On Thu, Sep 12, 2019 at 07:19:30PM +0200, Heinrich Schuchardt wrote:

> If out of memory, return -1 and not -ENOMEM from get_contents().
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index b4e8083734..da822f4f38 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -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) {