[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5107E9C7.1090302@ti.com>
Date: Tue, 29 Jan 2013 09:24:55 -0600
From: Rob Clark <rob@...com>
To: Peter Huewe <peterhuewe@....de>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andy Gross <andy.gross@...com>,
YAMANE Toshiaki <yamanetoshi@...il.com>,
"Vincent Penquerc'h" <vincent.penquerch@...labora.co.uk>,
<devel@...verdev.osuosl.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] staging/omapdrm: Use kmemdup rather than duplicating
its implementation
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@....de>
Signed-off-by: Rob Clark <rob@...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)) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists