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>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
0b3af1b6df
commit
7408187d22
@@ -109,10 +109,9 @@ static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages)
|
||||
struct page *pg;
|
||||
int i;
|
||||
|
||||
sglist = kmalloc(sizeof(struct scatterlist)*nr_pages, GFP_KERNEL);
|
||||
sglist = kcalloc(nr_pages, sizeof(struct scatterlist), GFP_KERNEL);
|
||||
if (NULL == sglist)
|
||||
return NULL;
|
||||
memset(sglist,0,sizeof(struct scatterlist)*nr_pages);
|
||||
for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) {
|
||||
pg = vmalloc_to_page(virt);
|
||||
if (NULL == pg)
|
||||
@@ -306,15 +305,13 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent
|
||||
struct saa7146_dev *dev;
|
||||
int err = -ENOMEM;
|
||||
|
||||
dev = kmalloc(sizeof(struct saa7146_dev), GFP_KERNEL);
|
||||
/* clear out mem for sure */
|
||||
dev = kzalloc(sizeof(struct saa7146_dev), GFP_KERNEL);
|
||||
if (!dev) {
|
||||
ERR(("out of memory.\n"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* clear out mem for sure */
|
||||
memset(dev, 0x0, sizeof(struct saa7146_dev));
|
||||
|
||||
DEB_EE(("pci:%p\n",pci));
|
||||
|
||||
err = pci_enable_device(pci);
|
||||
|
Reference in New Issue
Block a user