diff options
-rw-r--r-- | fs/pstore/inode.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 0e806aafe857..549d245d0b42 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c | |||
@@ -256,23 +256,28 @@ static struct file_system_type pstore_fs_type = { | |||
256 | 256 | ||
257 | static int __init init_pstore_fs(void) | 257 | static int __init init_pstore_fs(void) |
258 | { | 258 | { |
259 | int ret = 0; | 259 | int rc = 0; |
260 | struct kobject *pstorefs_kobj; | 260 | struct kobject *pstorefs_kobj; |
261 | 261 | ||
262 | pstorefs_kobj = kobject_create_and_add("pstore", fs_kobj); | 262 | pstorefs_kobj = kobject_create_and_add("pstore", fs_kobj); |
263 | if (!pstorefs_kobj) | 263 | if (!pstorefs_kobj) { |
264 | return -ENOMEM; | 264 | rc = -ENOMEM; |
265 | goto done; | ||
266 | } | ||
265 | 267 | ||
266 | sysfs_create_file(pstorefs_kobj, &pstore_kmsg_bytes_attr.attr); | 268 | rc = sysfs_create_file(pstorefs_kobj, &pstore_kmsg_bytes_attr.attr); |
269 | if (rc) | ||
270 | goto done1; | ||
267 | 271 | ||
268 | ret = register_filesystem(&pstore_fs_type); | 272 | rc = register_filesystem(&pstore_fs_type); |
273 | if (rc == 0) | ||
274 | goto done; | ||
269 | 275 | ||
270 | if (ret) { | 276 | sysfs_remove_file(pstorefs_kobj, &pstore_kmsg_bytes_attr.attr); |
271 | sysfs_remove_file(pstorefs_kobj, &pstore_kmsg_bytes_attr.attr); | 277 | done1: |
272 | kobject_put(pstorefs_kobj); | 278 | kobject_put(pstorefs_kobj); |
273 | } | 279 | done: |
274 | 280 | return rc; | |
275 | return ret; | ||
276 | } | 281 | } |
277 | module_init(init_pstore_fs) | 282 | module_init(init_pstore_fs) |
278 | 283 | ||