Commit 6aec8c56 authored by Aishwarya Pant's avatar Aishwarya Pant Committed by Greg Kroah-Hartman

staging: bcm2835-camera: replace kmalloc with kzalloc

This patch replaces kmalloc and memset with kzalloc
Signed-off-by: default avatarAishwarya Pant <aishpant@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a1d76d7a
...@@ -258,13 +258,12 @@ get_msg_context(struct vchiq_mmal_instance *instance) ...@@ -258,13 +258,12 @@ get_msg_context(struct vchiq_mmal_instance *instance)
{ {
struct mmal_msg_context *msg_context; struct mmal_msg_context *msg_context;
/* todo: should this be allocated from a pool to avoid kmalloc */ /* todo: should this be allocated from a pool to avoid kzalloc */
msg_context = kmalloc(sizeof(*msg_context), GFP_KERNEL); msg_context = kzalloc(sizeof(*msg_context), GFP_KERNEL);
if (!msg_context) if (!msg_context)
return NULL; return NULL;
memset(msg_context, 0, sizeof(*msg_context));
msg_context->instance = instance; msg_context->instance = instance;
msg_context->handle = msg_context->handle =
mmal_context_map_create_handle(&instance->context_map, mmal_context_map_create_handle(&instance->context_map,
...@@ -2017,12 +2016,11 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance) ...@@ -2017,12 +2016,11 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance)
return -EIO; return -EIO;
} }
instance = kmalloc(sizeof(*instance), GFP_KERNEL); instance = kzalloc(sizeof(*instance), GFP_KERNEL);
if (!instance) if (!instance)
return -ENOMEM; return -ENOMEM;
memset(instance, 0, sizeof(*instance));
mutex_init(&instance->vchiq_mutex); mutex_init(&instance->vchiq_mutex);
mutex_init(&instance->bulk_mutex); mutex_init(&instance->bulk_mutex);
......
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