]> err.no Git - linux-2.6/blobdiff - drivers/media/video/videocodec.c
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6] / drivers / media / video / videocodec.c
index 839db622040dcdcfe1ff344d7f8846b5c9a7ef53..87951ec8254f47cd8be33557237cd7bedf54d902 100644 (file)
@@ -36,7 +36,6 @@
 #include <linux/slab.h>
 
 // kernel config is here (procfs flag)
-#include <linux/config.h>
 
 #ifdef CONFIG_PROC_FS
 #include <linux/proc_fs.h>
@@ -87,8 +86,8 @@ videocodec_attach (struct videocodec_master *master)
        }
 
        dprintk(2,
-               "videocodec_attach: '%s', type: %x, flags %lx, magic %lx\n",
-               master->name, master->type, master->flags, master->magic);
+               "videocodec_attach: '%s', flags %lx, magic %lx\n",
+               master->name, master->flags, master->magic);
 
        if (!h) {
                dprintk(1,
@@ -124,17 +123,13 @@ videocodec_attach (struct videocodec_master *master)
                        if (res == 0) {
                                dprintk(3, "videocodec_attach '%s'\n",
                                        codec->name);
-                               ptr = (struct attached_list *)
-                                   kmalloc(sizeof(struct attached_list),
-                                           GFP_KERNEL);
+                               ptr = kzalloc(sizeof(struct attached_list), GFP_KERNEL);
                                if (!ptr) {
                                        dprintk(1,
                                                KERN_ERR
                                                "videocodec_attach: no memory\n");
                                        goto out_kfree;
                                }
-                               memset(ptr, 0,
-                                      sizeof(struct attached_list));
                                ptr->codec = codec;
 
                                a = h->list;
@@ -249,14 +244,11 @@ videocodec_register (const struct videocodec *codec)
                "videocodec: register '%s', type: %x, flags %lx, magic %lx\n",
                codec->name, codec->type, codec->flags, codec->magic);
 
-       ptr =
-           (struct codec_list *) kmalloc(sizeof(struct codec_list),
-                                         GFP_KERNEL);
+       ptr = kzalloc(sizeof(struct codec_list), GFP_KERNEL);
        if (!ptr) {
                dprintk(1, KERN_ERR "videocodec_register: no memory\n");
                return -ENOMEM;
        }
-       memset(ptr, 0, sizeof(struct codec_list));
        ptr->codec = codec;
 
        if (!h) {
@@ -354,7 +346,10 @@ videocodec_build_table (void)
                size);
 
        kfree(videocodec_buf);
-       videocodec_buf = (char *) kmalloc(size, GFP_KERNEL);
+       videocodec_buf = kmalloc(size, GFP_KERNEL);
+
+       if (!videocodec_buf)
+               return 0;
 
        i = 0;
        i += scnprintf(videocodec_buf + i, size - 1,