mini_fo: add error pointer checks after dentry lookups to fix various crash bugs...
[openwrt/svn-archive/archive.git] / target / linux / generic / patches-2.6.35 / 218-mini_fo_dentry_check.patch
1 --- a/fs/mini_fo/meta.c
2 +++ b/fs/mini_fo/meta.c
3 @@ -48,6 +48,9 @@ int meta_build_lists(dentry_t *dentry)
4 dtohd2(dentry),
5 strlen(META_FILENAME));
6 mutex_unlock(&dtohd2(dentry)->d_inode->i_mutex);
7 + if (IS_ERR(meta_dentry))
8 + goto out_ok;
9 +
10 if(!meta_dentry->d_inode) {
11 dput(meta_dentry);
12 goto out_ok;
13 @@ -433,6 +436,8 @@ int meta_write_d_entry(dentry_t *dentry,
14 meta_dentry = lookup_one_len(META_FILENAME,
15 dtohd2(dentry), strlen (META_FILENAME));
16 mutex_unlock(&dtohd2(dentry)->d_inode->i_mutex);
17 + if (IS_ERR(meta_dentry))
18 + return PTR_ERR(meta_dentry);
19
20 /* We need to create a META-file */
21 if(!meta_dentry->d_inode) {
22 @@ -538,6 +543,8 @@ int meta_write_r_entry(dentry_t *dentry,
23 dtohd2(dentry),
24 strlen (META_FILENAME));
25 mutex_unlock(&dtohd2(dentry)->d_inode->i_mutex);
26 + if (IS_ERR(meta_dentry))
27 + return PTR_ERR(meta_dentry);
28
29 if(!meta_dentry->d_inode) {
30 /* We need to create a META-file */
31 @@ -656,6 +663,8 @@ int meta_sync_d_list(dentry_t *dentry, i
32 dtohd2(dentry),
33 strlen(META_FILENAME));
34 mutex_unlock(&dtohd2(dentry)->d_inode->i_mutex);
35 + if (IS_ERR(meta_dentry))
36 + return PTR_ERR(meta_dentry);
37
38 if(!meta_dentry->d_inode) {
39 /* We need to create a META-file */
40 @@ -803,6 +812,8 @@ int meta_sync_r_list(dentry_t *dentry, i
41 dtohd2(dentry),
42 strlen(META_FILENAME));
43 mutex_unlock(&dtohd2(dentry)->d_inode->i_mutex);
44 + if (IS_ERR(meta_dentry))
45 + return PTR_ERR(meta_dentry);
46
47 if(!meta_dentry->d_inode) {
48 /* We need to create a META-file */