Commit 20634fd1 authored by Amitoj Kaur Chawla's avatar Amitoj Kaur Chawla Committed by Mauro Carvalho Chehab

[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: default avatarAmitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent e95be158
...@@ -1569,10 +1569,9 @@ static int ddb_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1569,10 +1569,9 @@ static int ddb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
if (pci_enable_device(pdev) < 0) if (pci_enable_device(pdev) < 0)
return -ENODEV; return -ENODEV;
dev = vmalloc(sizeof(struct ddb)); dev = vzalloc(sizeof(struct ddb));
if (dev == NULL) if (dev == NULL)
return -ENOMEM; return -ENOMEM;
memset(dev, 0, sizeof(struct ddb));
dev->pdev = pdev; dev->pdev = pdev;
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment