summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>2016-06-20 02:55:52 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-07-08 16:36:43 -0300
commit20634fd1cd3b004088847318024a714f17f2d975 (patch)
tree52296f85fc4f30f393efe110df8f41eac1a15f21 /drivers
parente95be15886ac9a931f540073c1c0db299e806f3c (diff)
[media] ddbridge: Replace vmalloc with vzalloc
vzalloc combines vmalloc and memset 0. The Coccinelle semantic patch used to make this change is as follows: @@ type T; T *d; expression e; statement S; @@ d = - vmalloc + vzalloc (...); if (!d) S - memset(d, 0, sizeof(T)); Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/pci/ddbridge/ddbridge-core.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c
index 6e995ef8c37e..47def73b3502 100644
--- a/drivers/media/pci/ddbridge/ddbridge-core.c
+++ b/drivers/media/pci/ddbridge/ddbridge-core.c
@@ -1569,10 +1569,9 @@ static int ddb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
if (pci_enable_device(pdev) < 0)
return -ENODEV;
- dev = vmalloc(sizeof(struct ddb));
+ dev = vzalloc(sizeof(struct ddb));
if (dev == NULL)
return -ENOMEM;
- memset(dev, 0, sizeof(struct ddb));
dev->pdev = pdev;
pci_set_drvdata(pdev, dev);