File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 23
23
#include <linux/pstore.h>
24
24
#include <linux/slab.h>
25
25
#include <linux/uaccess.h>
26
+ #include <linux/cleanup.h>
26
27
27
28
#include "internal.h"
28
29
@@ -64,21 +65,18 @@ static void free_pstore_private(struct pstore_private *private)
64
65
static void * pstore_ftrace_seq_start (struct seq_file * s , loff_t * pos )
65
66
{
66
67
struct pstore_private * ps = s -> private ;
67
- struct pstore_ftrace_seq_data * data ;
68
+ struct pstore_ftrace_seq_data * data __free ( kfree ) = NULL ;
68
69
69
70
data = kzalloc (sizeof (* data ), GFP_KERNEL );
70
71
if (!data )
71
72
return NULL ;
72
73
73
74
data -> off = ps -> total_size % REC_SIZE ;
74
75
data -> off += * pos * REC_SIZE ;
75
- if (data -> off + REC_SIZE > ps -> total_size ) {
76
- kfree (data );
76
+ if (data -> off + REC_SIZE > ps -> total_size )
77
77
return NULL ;
78
- }
79
-
80
- return data ;
81
78
79
+ return_ptr (data );
82
80
}
83
81
84
82
static void pstore_ftrace_seq_stop (struct seq_file * s , void * v )
You can’t perform that action at this time.
0 commit comments