Skip to contentSkip to conversation

fuse_file_alloc(): fix NULL dereferences

PATCH In review Adrian Bunk 2 participants 2 messages Oct 19, 2007 FUSE filesystem core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fuse_file_alloc(): fix NULL dereferences

This patch fixes obvious NULL dereferences spotted by the Coverity checker.

---
53b7c67ef9b6c26a0c7f554fef43021633a48ab7

fs/fuse/file.c +3 -2
index 0fcdba9..535b373 100644
@@ -55,9 +55,10 @@ struct fuse_file *fuse_file_alloc(void)
 		if (!ff->reserved_req) {
 			kfree(ff);
 			ff = NULL;
+		} else {
+			INIT_LIST_HEAD(&ff->write_entry);
+			atomic_set(&ff->count, 0);
 		}
-		INIT_LIST_HEAD(&ff->write_entry);
-		atomic_set(&ff->count, 0);
 	}
 	return ff;
 }
maintainer
#1 lore raw
Quoted 2 lines

This patch fixes obvious NULL dereferences spotted by the Coverity checker.

Thanks!

Miklos