]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/base/memory.c
[PATCH] v4l: 892: correct nicam audio settings to match dscaler
[linux-2.6-omap-h63xx.git] / drivers / base / memory.c
index 785cb6e6b91c6d71606cab20055260b6f0da6572..b7ddd651d664ecf76da5f620bd06b0e6d01ba837 100644 (file)
@@ -340,15 +340,12 @@ static int memory_probe_init(void)
 static int add_memory_block(unsigned long node_id, struct mem_section *section,
                     unsigned long state, int phys_device)
 {
-       size_t size = sizeof(struct memory_block);
-       struct memory_block *mem = kmalloc(size, GFP_KERNEL);
+       struct memory_block *mem = kzalloc(sizeof(*mem), GFP_KERNEL);
        int ret = 0;
 
        if (!mem)
                return -ENOMEM;
 
-       memset(mem, 0, size);
-
        mem->phys_index = __section_nr(section);
        mem->state = state;
        init_MUTEX(&mem->state_sem);