From: Greg KH <gregkh@linuxfoundation.org>
To: Aishwarya Pant <aishpant@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [PATCH 2/3] staging: bcm2835-camera: replace kmalloc with kzalloc
Date: Thu, 9 Mar 2017 19:39:55 +0100 [thread overview]
Message-ID: <20170309183955.GA15957@kroah.com> (raw)
In-Reply-To: <56b08acb54e6fa814f201c7813255fb3926631b6.1489082995.git.aishpant@gmail.com>
On Thu, Mar 09, 2017 at 11:43:48PM +0530, Aishwarya Pant wrote:
> This patch replaces kmalloc and memset with kzalloc
>
> Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
> ---
> drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
> index a258a72..f795137 100644
> --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
> +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
> @@ -259,9 +259,8 @@ get_msg_context(struct vchiq_mmal_instance *instance)
> {
> struct mmal_msg_context *msg_context;
>
> - /* todo: should this be allocated from a pool to avoid kmalloc */
> - msg_context = kmalloc(sizeof(*msg_context), GFP_KERNEL);
> - memset(msg_context, 0, sizeof(*msg_context));
> + /* todo: should this be allocated from a pool to avoid kzalloc */
> + msg_context = kzalloc(sizeof(*msg_context), GFP_KERNEL);
>
> if (!msg_context)
> return NULL;
> @@ -2008,8 +2007,7 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance)
> return -EIO;
> }
>
> - instance = kmalloc(sizeof(*instance), GFP_KERNEL);
> - memset(instance, 0, sizeof(*instance));
> + instance = kzalloc(sizeof(*instance), GFP_KERNEL);
>
> if (!instance)
> return -ENOMEM;
Does not apply to my tree :(
Please rebase and resend.
thanks,
greg k-h
next prev parent reply other threads:[~2017-03-09 18:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-09 18:13 [PATCH 0/3] staging: bcm2835-camera: fix coding style issues Aishwarya Pant
2017-03-09 18:13 ` [PATCH 1/3] staging: bcm2835-camera: add check to avoid null pointer dereference Aishwarya Pant
2017-03-09 18:39 ` Greg KH
2017-03-09 18:13 ` [PATCH 2/3] staging: bcm2835-camera: replace kmalloc with kzalloc Aishwarya Pant
2017-03-09 18:39 ` Greg KH [this message]
2017-03-09 18:14 ` [PATCH 3/3] staging: bcm2835-camera: use kernel preferred style for handling errors Aishwarya Pant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170309183955.GA15957@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=aishpant@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.