diff options
author | Panagiotis Issaris <takis@issaris.org> | 2006-01-11 16:40:56 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2006-01-11 16:40:56 -0500 |
commit | 7408187d223f63d46a13b6a35b8f96b032c2f623 (patch) | |
tree | 425a459f760295de488f57e3f97b034aaa76a78d /drivers/media/common/saa7146_core.c | |
parent | 0b3af1b6df82cfdb54ae294ed860263011fa0408 (diff) |
V4L/DVB (3344a): Conversions from kmalloc+memset to k(z|c)alloc
Conversions from kmalloc+memset to k(z|c)alloc.
Signed-off-by: Panagiotis Issaris <takis@issaris.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/common/saa7146_core.c')
-rw-r--r-- | drivers/media/common/saa7146_core.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/media/common/saa7146_core.c b/drivers/media/common/saa7146_core.c index 2899d34e5f7..04c1938b9c9 100644 --- a/drivers/media/common/saa7146_core.c +++ b/drivers/media/common/saa7146_core.c | |||
@@ -109,10 +109,9 @@ static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages) | |||
109 | struct page *pg; | 109 | struct page *pg; |
110 | int i; | 110 | int i; |
111 | 111 | ||
112 | sglist = kmalloc(sizeof(struct scatterlist)*nr_pages, GFP_KERNEL); | 112 | sglist = kcalloc(nr_pages, sizeof(struct scatterlist), GFP_KERNEL); |
113 | if (NULL == sglist) | 113 | if (NULL == sglist) |
114 | return NULL; | 114 | return NULL; |
115 | memset(sglist,0,sizeof(struct scatterlist)*nr_pages); | ||
116 | for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) { | 115 | for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) { |
117 | pg = vmalloc_to_page(virt); | 116 | pg = vmalloc_to_page(virt); |
118 | if (NULL == pg) | 117 | if (NULL == pg) |
@@ -306,15 +305,13 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent | |||
306 | struct saa7146_dev *dev; | 305 | struct saa7146_dev *dev; |
307 | int err = -ENOMEM; | 306 | int err = -ENOMEM; |
308 | 307 | ||
309 | dev = kmalloc(sizeof(struct saa7146_dev), GFP_KERNEL); | 308 | /* clear out mem for sure */ |
309 | dev = kzalloc(sizeof(struct saa7146_dev), GFP_KERNEL); | ||
310 | if (!dev) { | 310 | if (!dev) { |
311 | ERR(("out of memory.\n")); | 311 | ERR(("out of memory.\n")); |
312 | goto out; | 312 | goto out; |
313 | } | 313 | } |
314 | 314 | ||
315 | /* clear out mem for sure */ | ||
316 | memset(dev, 0x0, sizeof(struct saa7146_dev)); | ||
317 | |||
318 | DEB_EE(("pci:%p\n",pci)); | 315 | DEB_EE(("pci:%p\n",pci)); |
319 | 316 | ||
320 | err = pci_enable_device(pci); | 317 | err = pci_enable_device(pci); |