diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-05-14 21:44:31 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-05-14 21:50:59 +0200 |
commit | 9963bb4d157c4b958735855ee3f115435a70ee9f (patch) | |
tree | 655c7e00766fb699682394d27a4d520156328aaf /fs | |
parent | 7b5817e58d77d44d1e85fb25e384785d2682ed7d (diff) | |
download | barebox-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.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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) |