diff options
author | Aishwarya Pant <aishpant@gmail.com> | 2017-03-10 00:31:36 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-10 10:13:07 +0100 |
commit | b8f93267628b22e452251a5f1913b069544b29f7 (patch) | |
tree | e9806c8b38bcddadf8f9b9887f4adfc2b7b7214f /drivers/staging/vc04_services | |
parent | 6aec8c56bc36f4fb4f315d14a8b6da434dd756a4 (diff) |
staging: bcm2835-camera: use kernel preferred style for handling errors
This patch replaces NULL error values with error pointer values.
Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vc04_services')
-rw-r--r-- | drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c index 2be6a040bbc1..803095ee6c85 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c @@ -262,7 +262,7 @@ get_msg_context(struct vchiq_mmal_instance *instance) msg_context = kzalloc(sizeof(*msg_context), GFP_KERNEL); if (!msg_context) - return NULL; + return ERR_PTR(-ENOMEM); msg_context->instance = instance; msg_context->handle = @@ -272,7 +272,7 @@ get_msg_context(struct vchiq_mmal_instance *instance) if (!msg_context->handle) { kfree(msg_context); - return NULL; + return ERR_PTR(-ENOMEM); } return msg_context; @@ -507,8 +507,8 @@ buffer_from_host(struct vchiq_mmal_instance *instance, /* get context */ msg_context = get_msg_context(instance); - if (!msg_context) { - ret = -ENOMEM; + if (IS_ERR(msg_context)) { + ret = PTR_ERR(msg_context); goto unlock; } @@ -845,8 +845,8 @@ static int send_synchronous_mmal_msg(struct vchiq_mmal_instance *instance, } msg_context = get_msg_context(instance); - if (!msg_context) - return -ENOMEM; + if (IS_ERR(msg_context)) + return PTR_ERR(msg_context); init_completion(&msg_context->u.sync.cmplt); |