File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change 1
1
// SPDX-License-Identifier: GPL-2.0-only
2
2
// Copyright(c) 2017-2019 Intel Corporation.
3
3
4
+ #include <linux/cleanup.h>
4
5
#include <linux/device.h>
5
6
#include <linux/debugfs.h>
6
7
#include <linux/firmware.h>
@@ -49,18 +50,16 @@ static ssize_t sdw_sprintf(struct sdw_slave *slave,
49
50
static int sdw_slave_reg_show (struct seq_file * s_file , void * data )
50
51
{
51
52
struct sdw_slave * slave = s_file -> private ;
52
- char * buf ;
53
53
ssize_t ret ;
54
54
int i , j ;
55
55
56
- buf = kzalloc (RD_BUF , GFP_KERNEL );
56
+ char * buf __free ( kfree ) = kzalloc (RD_BUF , GFP_KERNEL );
57
57
if (!buf )
58
58
return - ENOMEM ;
59
59
60
60
ret = pm_runtime_get_sync (& slave -> dev );
61
61
if (ret < 0 && ret != - EACCES ) {
62
62
pm_runtime_put_noidle (& slave -> dev );
63
- kfree (buf );
64
63
return ret ;
65
64
}
66
65
@@ -132,8 +131,6 @@ static int sdw_slave_reg_show(struct seq_file *s_file, void *data)
132
131
pm_runtime_mark_last_busy (& slave -> dev );
133
132
pm_runtime_put (& slave -> dev );
134
133
135
- kfree (buf );
136
-
137
134
return 0 ;
138
135
}
139
136
DEFINE_SHOW_ATTRIBUTE (sdw_slave_reg );
You can’t perform that action at this time.
0 commit comments