|
|
@@ -330,10 +330,6 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record)
|
|
|
goto fail;
|
|
|
inode->i_mode = S_IFREG | 0444;
|
|
|
inode->i_fop = &pstore_file_operations;
|
|
|
- private = kzalloc(sizeof(*private), GFP_KERNEL);
|
|
|
- if (!private)
|
|
|
- goto fail_alloc;
|
|
|
- private->record = record;
|
|
|
|
|
|
switch (record->type) {
|
|
|
case PSTORE_TYPE_DMESG:
|
|
|
@@ -383,12 +379,16 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record)
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
+ private = kzalloc(sizeof(*private), GFP_KERNEL);
|
|
|
+ if (!private)
|
|
|
+ goto fail_inode;
|
|
|
+
|
|
|
dentry = d_alloc_name(root, name);
|
|
|
if (!dentry)
|
|
|
goto fail_private;
|
|
|
|
|
|
+ private->record = record;
|
|
|
inode->i_size = private->total_size = size;
|
|
|
-
|
|
|
inode->i_private = private;
|
|
|
|
|
|
if (record->time.tv_sec)
|
|
|
@@ -404,7 +404,7 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record)
|
|
|
|
|
|
fail_private:
|
|
|
free_pstore_private(private);
|
|
|
-fail_alloc:
|
|
|
+fail_inode:
|
|
|
iput(inode);
|
|
|
|
|
|
fail:
|