diff options
Diffstat (limited to 'fs/jffs2')
-rw-r--r-- | fs/jffs2/readinode.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c index 4884d5edfe65..5663e8c7a959 100644 --- a/fs/jffs2/readinode.c +++ b/fs/jffs2/readinode.c | |||
@@ -1044,7 +1044,8 @@ static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_inf | |||
1044 | 1044 | ||
1045 | case JFFS2_NODETYPE_DIRENT: | 1045 | case JFFS2_NODETYPE_DIRENT: |
1046 | 1046 | ||
1047 | if (JFFS2_MIN_NODE_HEADER < sizeof(struct jffs2_raw_dirent)) { | 1047 | if (JFFS2_MIN_NODE_HEADER < sizeof(struct jffs2_raw_dirent) && |
1048 | len < sizeof(struct jffs2_raw_dirent)) { | ||
1048 | err = read_more(c, ref, sizeof(struct jffs2_raw_dirent), &len, buf); | 1049 | err = read_more(c, ref, sizeof(struct jffs2_raw_dirent), &len, buf); |
1049 | if (unlikely(err)) | 1050 | if (unlikely(err)) |
1050 | goto free_out; | 1051 | goto free_out; |
@@ -1058,7 +1059,8 @@ static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_inf | |||
1058 | 1059 | ||
1059 | case JFFS2_NODETYPE_INODE: | 1060 | case JFFS2_NODETYPE_INODE: |
1060 | 1061 | ||
1061 | if (JFFS2_MIN_NODE_HEADER < sizeof(struct jffs2_raw_inode)) { | 1062 | if (JFFS2_MIN_NODE_HEADER < sizeof(struct jffs2_raw_inode) && |
1063 | len < sizeof(struct jffs2_raw_inode)) { | ||
1062 | err = read_more(c, ref, sizeof(struct jffs2_raw_inode), &len, buf); | 1064 | err = read_more(c, ref, sizeof(struct jffs2_raw_inode), &len, buf); |
1063 | if (unlikely(err)) | 1065 | if (unlikely(err)) |
1064 | goto free_out; | 1066 | goto free_out; |
@@ -1071,7 +1073,8 @@ static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_inf | |||
1071 | break; | 1073 | break; |
1072 | 1074 | ||
1073 | default: | 1075 | default: |
1074 | if (JFFS2_MIN_NODE_HEADER < sizeof(struct jffs2_unknown_node)) { | 1076 | if (JFFS2_MIN_NODE_HEADER < sizeof(struct jffs2_unknown_node) && |
1077 | len < sizeof(struct jffs2_unknown_node)) { | ||
1075 | err = read_more(c, ref, sizeof(struct jffs2_unknown_node), &len, buf); | 1078 | err = read_more(c, ref, sizeof(struct jffs2_unknown_node), &len, buf); |
1076 | if (unlikely(err)) | 1079 | if (unlikely(err)) |
1077 | goto free_out; | 1080 | goto free_out; |