From patchwork Sat May 15 21:15:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 99872 X-Patchwork-Delegate: dougsland@redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4FLG0ql014951 for ; Sat, 15 May 2010 21:16:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754284Ab0EOVPf (ORCPT ); Sat, 15 May 2010 17:15:35 -0400 Received: from mgw2.diku.dk ([130.225.96.92]:59046 "EHLO mgw2.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752744Ab0EOVPc (ORCPT ); Sat, 15 May 2010 17:15:32 -0400 Received: from localhost (localhost [127.0.0.1]) by mgw2.diku.dk (Postfix) with ESMTP id DFABA19BB65; Sat, 15 May 2010 23:15:31 +0200 (CEST) Received: from mgw2.diku.dk ([127.0.0.1]) by localhost (mgw2.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08537-03; Sat, 15 May 2010 23:15:27 +0200 (CEST) Received: from nhugin.diku.dk (nhugin.diku.dk [130.225.96.140]) by mgw2.diku.dk (Postfix) with ESMTP id C071419BB3C; Sat, 15 May 2010 23:15:27 +0200 (CEST) Received: from ask.diku.dk (ask.diku.dk [130.225.96.225]) by nhugin.diku.dk (Postfix) with ESMTP id 476986DFD25; Sat, 15 May 2010 23:08:16 +0200 (CEST) Received: by ask.diku.dk (Postfix, from userid 3767) id A5803200BE; Sat, 15 May 2010 23:15:27 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by ask.diku.dk (Postfix) with ESMTP id 9D686200BC; Sat, 15 May 2010 23:15:27 +0200 (CEST) Date: Sat, 15 May 2010 23:15:27 +0200 (CEST) From: Julia Lawall To: Mauro Carvalho Chehab , mjpeg-users@lists.sourceforge.net, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 8/37] drivers/media/video/zoran: Use kmemdup Message-ID: MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 15 May 2010 21:16:00 +0000 (UTC) diff -u -p a/drivers/media/video/zoran/videocodec.c b/drivers/media/video/zoran/videocodec.c --- a/drivers/media/video/zoran/videocodec.c +++ b/drivers/media/video/zoran/videocodec.c @@ -107,15 +107,14 @@ videocodec_attach (struct videocodec_mas if (!try_module_get(h->codec->owner)) return NULL; - codec = - kmalloc(sizeof(struct videocodec), GFP_KERNEL); + codec = kmemdup(h->codec, sizeof(struct videocodec), + GFP_KERNEL); if (!codec) { dprintk(1, KERN_ERR "videocodec_attach: no mem\n"); goto out_module_put; } - memcpy(codec, h->codec, sizeof(struct videocodec)); snprintf(codec->name, sizeof(codec->name), "%s[%d]", codec->name, h->attached);