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

staging: bcm2835-camera: use kernel preferred style for handling errors

This patch replaces NULL error values with error pointer values.
Signed-off-by: default avatarAishwarya Pant <aishpant@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6aec8c56
...@@ -262,7 +262,7 @@ get_msg_context(struct vchiq_mmal_instance *instance) ...@@ -262,7 +262,7 @@ get_msg_context(struct vchiq_mmal_instance *instance)
msg_context = kzalloc(sizeof(*msg_context), GFP_KERNEL); msg_context = kzalloc(sizeof(*msg_context), GFP_KERNEL);
if (!msg_context) if (!msg_context)
return NULL; return ERR_PTR(-ENOMEM);
msg_context->instance = instance; msg_context->instance = instance;
msg_context->handle = msg_context->handle =
...@@ -272,7 +272,7 @@ get_msg_context(struct vchiq_mmal_instance *instance) ...@@ -272,7 +272,7 @@ get_msg_context(struct vchiq_mmal_instance *instance)
if (!msg_context->handle) { if (!msg_context->handle) {
kfree(msg_context); kfree(msg_context);
return NULL; return ERR_PTR(-ENOMEM);
} }
return msg_context; return msg_context;
...@@ -507,8 +507,8 @@ buffer_from_host(struct vchiq_mmal_instance *instance, ...@@ -507,8 +507,8 @@ buffer_from_host(struct vchiq_mmal_instance *instance,
/* get context */ /* get context */
msg_context = get_msg_context(instance); msg_context = get_msg_context(instance);
if (!msg_context) { if (IS_ERR(msg_context)) {
ret = -ENOMEM; ret = PTR_ERR(msg_context);
goto unlock; goto unlock;
} }
...@@ -845,8 +845,8 @@ static int send_synchronous_mmal_msg(struct vchiq_mmal_instance *instance, ...@@ -845,8 +845,8 @@ static int send_synchronous_mmal_msg(struct vchiq_mmal_instance *instance,
} }
msg_context = get_msg_context(instance); msg_context = get_msg_context(instance);
if (!msg_context) if (IS_ERR(msg_context))
return -ENOMEM; return PTR_ERR(msg_context);
init_completion(&msg_context->u.sync.cmplt); init_completion(&msg_context->u.sync.cmplt);
......
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