[PATCH 4/5] ubifs: fix potential NULL ptr dereference

Lucas Stach dev at lynxeye.de
Wed Jul 6 12:32:51 PDT 2016


Signed-off-by: Lucas Stach <dev at lynxeye.de>
---
 fs/ubifs/ubifs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index 8062baa..bc1b521 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -479,7 +479,7 @@ out:
 		dbg_gen("cannot find next direntry, error %d", err);
 
 out_free:
-	if (file->private_data)
+	if (file && file->private_data)
 		kfree(file->private_data);
 	if (file)
 		free(file);
-- 
2.7.4




More information about the barebox mailing list