X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=sound%2Fcore%2Fmisc.c;h=b53e563c09e60d0e16f843bb034d0842df0cc432;hb=cf70a6f264f6e1a4c06553699159d94996b2f916;hp=1a81fe4df218b2a47c7428d7b5225bc6b1ad8446;hpb=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2;p=powerpc.git diff --git a/sound/core/misc.c b/sound/core/misc.c index 1a81fe4df2..b53e563c09 100644 --- a/sound/core/misc.c +++ b/sound/core/misc.c @@ -23,17 +23,15 @@ #include #include #include +#include #include -int snd_task_name(struct task_struct *task, char *name, size_t size) +void release_and_free_resource(struct resource *res) { - unsigned int idx; - - snd_assert(task != NULL && name != NULL && size >= 2, return -EINVAL); - for (idx = 0; idx < sizeof(task->comm) && idx + 1 < size; idx++) - name[idx] = task->comm[idx]; - name[idx] = '\0'; - return 0; + if (res) { + release_resource(res); + kfree(res); + } } #ifdef CONFIG_SND_VERBOSE_PRINTK