summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-05-14 21:44:31 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-05-14 21:50:59 +0200
commit9963bb4d157c4b958735855ee3f115435a70ee9f (patch)
tree655c7e00766fb699682394d27a4d520156328aaf /fs
parent7b5817e58d77d44d1e85fb25e384785d2682ed7d (diff)
downloadbarebox-9963bb4d157c4b958735855ee3f115435a70ee9f.tar.gz
barebox-9963bb4d157c4b958735855ee3f115435a70ee9f.tar.xz
fs readdir: check for NULL pointer again
This got lost in: commit 6188685091c58c9772b990cf0ca6ac522f97a9d0 Author: Sascha Hauer <s.hauer@pengutronix.de> Date: Sun May 13 12:43:58 2012 +0200 Make errno a positive value Normally errno contains a positive error value. A certain unnamed developer mixed this up while implementing U-Boot-v2. Also, normally errno is never set to zero by any library function. This patch fixes this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/fs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/fs.c b/fs/fs.c
index ea5ed11587..e5ae6d532b 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -1077,6 +1077,9 @@ struct dirent *readdir(DIR *dir)
{
struct dirent *ent;
+ if (!dir)
+ return NULL;
+
ent = dir->fsdrv->readdir(dir->dev, dir);
if (!ent)