mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/6] fs: Drop needless OOM check
@ 2019-02-26 19:52 Andrey Smirnov
  2019-02-26 19:52 ` [PATCH 2/6] fs: ramfs: " Andrey Smirnov
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Andrey Smirnov @ 2019-02-26 19:52 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Drop needless OOM check since xzalloc() will never return NULL.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 fs/fs.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/fs/fs.c b/fs/fs.c
index 1f6b3d346..65de82518 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -809,9 +809,6 @@ static int fillonedir(struct dir_context *ctx, const char *name, int namlen,
 	struct readdir_entry *entry;
 
 	entry = xzalloc(sizeof(*entry));
-	if (!entry)
-		return -ENOMEM;
-
 	memcpy(entry->d.d_name, name, namlen);
 	list_add_tail(&entry->list, &rd->dir->entries);
 
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-02-27  7:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-26 19:52 [PATCH 1/6] fs: Drop needless OOM check Andrey Smirnov
2019-02-26 19:52 ` [PATCH 2/6] fs: ramfs: " Andrey Smirnov
2019-02-26 19:53 ` [PATCH 3/6] fs: Make use of cdev_erase() Andrey Smirnov
2019-02-26 19:53 ` [PATCH 4/6] fs: Make use of cdev_flush() Andrey Smirnov
2019-02-26 19:53 ` [PATCH 5/6] fs: Drop unused code in fstat() Andrey Smirnov
2019-02-26 19:53 ` [PATCH 6/6] fs: Simplify fd to FILE lookup code Andrey Smirnov
2019-02-27  7:35 ` [PATCH 1/6] fs: Drop needless OOM check Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox