From: Rob Clark <rob@ti.com>
To: Peter Huewe <peterhuewe@gmx.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Andy Gross <andy.gross@ti.com>,
YAMANE Toshiaki <yamanetoshi@gmail.com>,
"Vincent Penquerc'h" <vincent.penquerch@collabora.co.uk>,
<devel@driverdev.osuosl.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] staging/omapdrm: Use kmemdup rather than duplicating its implementation
Date: Tue, 29 Jan 2013 09:24:55 -0600 [thread overview]
Message-ID: <5107E9C7.1090302@ti.com> (raw)
In-Reply-To: <1359157213-626-1-git-send-email-peterhuewe@gmx.de>
On 01/25/2013 05:40 PM, Peter Huewe wrote:
> Found with coccicheck.
> The semantic patch that makes this change is available
> in scripts/coccinelle/api/memdup.cocci.
>
> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Rob Clark <rob@ti.com>
> ---
> drivers/staging/omapdrm/omap_gem.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/omapdrm/omap_gem.c b/drivers/staging/omapdrm/omap_gem.c
> index 08f1e292..f9297eb 100644
> --- a/drivers/staging/omapdrm/omap_gem.c
> +++ b/drivers/staging/omapdrm/omap_gem.c
> @@ -1267,12 +1267,12 @@ int omap_gem_set_sync_object(struct drm_gem_object *obj, void *syncobj)
>
> if ((omap_obj->flags & OMAP_BO_EXT_SYNC) && !syncobj) {
> /* clearing a previously set syncobj */
> - syncobj = kzalloc(sizeof(*omap_obj->sync), GFP_ATOMIC);
> + syncobj = kmemdup(omap_obj->sync, sizeof(*omap_obj->sync),
> + GFP_ATOMIC);
> if (!syncobj) {
> ret = -ENOMEM;
> goto unlock;
> }
> - memcpy(syncobj, omap_obj->sync, sizeof(*omap_obj->sync));
> omap_obj->flags &= ~OMAP_BO_EXT_SYNC;
> omap_obj->sync = syncobj;
> } else if (syncobj && !(omap_obj->flags & OMAP_BO_EXT_SYNC)) {
prev parent reply other threads:[~2013-01-29 15:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-25 23:40 Peter Huewe
2013-01-29 15:24 ` Rob Clark [this message]
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=5107E9C7.1090302@ti.com \
--to=rob@ti.com \
--cc=andy.gross@ti.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
--cc=vincent.penquerch@collabora.co.uk \
--cc=yamanetoshi@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome