File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 20
20
#include <linux/module.h>
21
21
#include <linux/init.h>
22
22
#include <linux/async.h>
23
+ #include <linux/cleanup.h>
23
24
#include <linux/delay.h>
24
25
#include <linux/pm.h>
25
26
#include <linux/bitops.h>
@@ -323,30 +324,28 @@ static inline struct snd_soc_dapm_widget *dapm_cnew_widget(
323
324
const struct snd_soc_dapm_widget * _widget ,
324
325
const char * prefix )
325
326
{
326
- struct snd_soc_dapm_widget * w ;
327
-
328
- w = kmemdup ( _widget , sizeof ( * _widget ), GFP_KERNEL );
327
+ struct snd_soc_dapm_widget * w __free ( kfree ) = kmemdup ( _widget ,
328
+ sizeof ( * _widget ),
329
+ GFP_KERNEL );
329
330
if (!w )
330
331
return NULL ;
331
332
332
333
if (prefix )
333
334
w -> name = kasprintf (GFP_KERNEL , "%s %s" , prefix , _widget -> name );
334
335
else
335
336
w -> name = kstrdup_const (_widget -> name , GFP_KERNEL );
336
- if (!w -> name ) {
337
- kfree (w );
337
+ if (!w -> name )
338
338
return NULL ;
339
- }
340
339
341
340
if (_widget -> sname ) {
342
341
w -> sname = kstrdup_const (_widget -> sname , GFP_KERNEL );
343
342
if (!w -> sname ) {
344
343
kfree_const (w -> name );
345
- kfree (w );
346
344
return NULL ;
347
345
}
348
346
}
349
- return w ;
347
+
348
+ return_ptr (w );
350
349
}
351
350
352
351
struct dapm_kcontrol_data {
You can’t perform that action at this time.
0 commit comments