diff options
Diffstat (limited to 'sound/firewire/iso-resources.c')
-rw-r--r-- | sound/firewire/iso-resources.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sound/firewire/iso-resources.c b/sound/firewire/iso-resources.c index 6f2b5f8651fd..775dbd5f3445 100644 --- a/sound/firewire/iso-resources.c +++ b/sound/firewire/iso-resources.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/jiffies.h> | 11 | #include <linux/jiffies.h> |
12 | #include <linux/mutex.h> | 12 | #include <linux/mutex.h> |
13 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
14 | #include <linux/slab.h> | ||
14 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
15 | #include "iso-resources.h" | 16 | #include "iso-resources.h" |
16 | 17 | ||
@@ -22,12 +23,18 @@ | |||
22 | * If the device does not support all channel numbers, change @r->channels_mask | 23 | * If the device does not support all channel numbers, change @r->channels_mask |
23 | * after calling this function. | 24 | * after calling this function. |
24 | */ | 25 | */ |
25 | void fw_iso_resources_init(struct fw_iso_resources *r, struct fw_unit *unit) | 26 | int fw_iso_resources_init(struct fw_iso_resources *r, struct fw_unit *unit) |
26 | { | 27 | { |
28 | r->buffer = kmalloc(2 * 4, GFP_KERNEL); | ||
29 | if (!r->buffer) | ||
30 | return -ENOMEM; | ||
31 | |||
27 | r->channels_mask = ~0uLL; | 32 | r->channels_mask = ~0uLL; |
28 | r->unit = fw_unit_get(unit); | 33 | r->unit = fw_unit_get(unit); |
29 | mutex_init(&r->mutex); | 34 | mutex_init(&r->mutex); |
30 | r->allocated = false; | 35 | r->allocated = false; |
36 | |||
37 | return 0; | ||
31 | } | 38 | } |
32 | 39 | ||
33 | /** | 40 | /** |
@@ -37,6 +44,7 @@ void fw_iso_resources_init(struct fw_iso_resources *r, struct fw_unit *unit) | |||
37 | void fw_iso_resources_destroy(struct fw_iso_resources *r) | 44 | void fw_iso_resources_destroy(struct fw_iso_resources *r) |
38 | { | 45 | { |
39 | WARN_ON(r->allocated); | 46 | WARN_ON(r->allocated); |
47 | kfree(r->buffer); | ||
40 | mutex_destroy(&r->mutex); | 48 | mutex_destroy(&r->mutex); |
41 | fw_unit_put(r->unit); | 49 | fw_unit_put(r->unit); |
42 | } | 50 | } |