Commit 1f8766b4 authored by Mats Randgaard's avatar Mats Randgaard Committed by Mauro Carvalho Chehab

V4L/DVB: vpif_cap/disp: Replaced kmalloc with kzalloc

Signed-off-by: default avatarMats Randgaard <mats.randgaard@tandberg.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@tandberg.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent ffa1b391
...@@ -793,7 +793,7 @@ static int vpif_open(struct file *filep) ...@@ -793,7 +793,7 @@ static int vpif_open(struct file *filep)
} }
/* Allocate memory for the file handle object */ /* Allocate memory for the file handle object */
fh = kmalloc(sizeof(struct vpif_fh), GFP_KERNEL); fh = kzalloc(sizeof(struct vpif_fh), GFP_KERNEL);
if (NULL == fh) { if (NULL == fh) {
vpif_err("unable to allocate memory for file handle object\n"); vpif_err("unable to allocate memory for file handle object\n");
ret = -ENOMEM; ret = -ENOMEM;
...@@ -1995,7 +1995,7 @@ static __init int vpif_probe(struct platform_device *pdev) ...@@ -1995,7 +1995,7 @@ static __init int vpif_probe(struct platform_device *pdev)
config = pdev->dev.platform_data; config = pdev->dev.platform_data;
subdev_count = config->subdev_count; subdev_count = config->subdev_count;
vpif_obj.sd = kmalloc(sizeof(struct v4l2_subdev *) * subdev_count, vpif_obj.sd = kzalloc(sizeof(struct v4l2_subdev *) * subdev_count,
GFP_KERNEL); GFP_KERNEL);
if (vpif_obj.sd == NULL) { if (vpif_obj.sd == NULL) {
vpif_err("unable to allocate memory for subdevice pointers\n"); vpif_err("unable to allocate memory for subdevice pointers\n");
......
...@@ -600,7 +600,7 @@ static int vpif_open(struct file *filep) ...@@ -600,7 +600,7 @@ static int vpif_open(struct file *filep)
ch = video_get_drvdata(vdev); ch = video_get_drvdata(vdev);
/* Allocate memory for the file handle object */ /* Allocate memory for the file handle object */
fh = kmalloc(sizeof(struct vpif_fh), GFP_KERNEL); fh = kzalloc(sizeof(struct vpif_fh), GFP_KERNEL);
if (fh == NULL) { if (fh == NULL) {
vpif_err("unable to allocate memory for file handle object\n"); vpif_err("unable to allocate memory for file handle object\n");
return -ENOMEM; return -ENOMEM;
...@@ -1396,7 +1396,7 @@ static int initialize_vpif(void) ...@@ -1396,7 +1396,7 @@ static int initialize_vpif(void)
/* Allocate memory for six channel objects */ /* Allocate memory for six channel objects */
for (i = 0; i < VPIF_DISPLAY_MAX_DEVICES; i++) { for (i = 0; i < VPIF_DISPLAY_MAX_DEVICES; i++) {
vpif_obj.dev[i] = vpif_obj.dev[i] =
kmalloc(sizeof(struct channel_obj), GFP_KERNEL); kzalloc(sizeof(struct channel_obj), GFP_KERNEL);
/* If memory allocation fails, return error */ /* If memory allocation fails, return error */
if (!vpif_obj.dev[i]) { if (!vpif_obj.dev[i]) {
free_channel_objects_index = i; free_channel_objects_index = i;
...@@ -1542,7 +1542,7 @@ static __init int vpif_probe(struct platform_device *pdev) ...@@ -1542,7 +1542,7 @@ static __init int vpif_probe(struct platform_device *pdev)
config = pdev->dev.platform_data; config = pdev->dev.platform_data;
subdev_count = config->subdev_count; subdev_count = config->subdev_count;
subdevdata = config->subdevinfo; subdevdata = config->subdevinfo;
vpif_obj.sd = kmalloc(sizeof(struct v4l2_subdev *) * subdev_count, vpif_obj.sd = kzalloc(sizeof(struct v4l2_subdev *) * subdev_count,
GFP_KERNEL); GFP_KERNEL);
if (vpif_obj.sd == NULL) { if (vpif_obj.sd == NULL) {
vpif_err("unable to allocate memory for subdevice pointers\n"); vpif_err("unable to allocate memory for subdevice pointers\n");
......
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