projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
19fd294
)
btrfs: fix uninitialized return value
author
David Sterba
<
[email protected]
>
Mon, 13 Jun 2011 15:18:23 +0000
(15:18 +0000)
committer
Chris Mason
<
[email protected]
>
Fri, 17 Jun 2011 18:54:18 +0000
(14:54 -0400)
When allocation fails in btrfs_read_fs_root_no_name, ret is not set
although it is returned, holding a garbage value.
Signed-off-by: David Sterba <
[email protected]
>
Reviewed-by: Li Zefan <
[email protected]
>
Signed-off-by: Chris Mason <
[email protected]
>
fs/btrfs/disk-io.c
patch
|
blob
|
history
diff --git
a/fs/btrfs/disk-io.c
b/fs/btrfs/disk-io.c
index c25ef5a0ccd69bb8611898ba7e1e4dc539ce125e..1ac8db5dc0a31b9a742099956b121cd75ba0a1a6 100644
(file)
--- a/
fs/btrfs/disk-io.c
+++ b/
fs/btrfs/disk-io.c
@@
-1299,12
+1299,12
@@
again:
return root;
root->free_ino_ctl = kzalloc(sizeof(*root->free_ino_ctl), GFP_NOFS);
- if (!root->free_ino_ctl)
- goto fail;
root->free_ino_pinned = kzalloc(sizeof(*root->free_ino_pinned),
GFP_NOFS);
- if (!root->free_ino_pinned)
+ if (!root->free_ino_pinned || !root->free_ino_ctl) {
+ ret = -ENOMEM;
goto fail;
+ }
btrfs_init_free_ino_ctl(root);
mutex_init(&root->fs_commit_mutex);