From patchwork Wed Apr 10 17:49:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrik Jakobsson X-Patchwork-Id: 2422571 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 5FACF3FCA5 for ; Wed, 10 Apr 2013 17:53:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 13BA3E6499 for ; Wed, 10 Apr 2013 10:53:16 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178]) by gabe.freedesktop.org (Postfix) with ESMTP id 9DA19E64B5 for ; Wed, 10 Apr 2013 10:50:53 -0700 (PDT) Received: by mail-lb0-f178.google.com with SMTP id q13so794382lbi.23 for ; Wed, 10 Apr 2013 10:50:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=0mWj37xG/eaRYMX0OqjJuWrGM2/qVF8eYVsMHENBq9A=; b=qdrXs/woAeFOL8SG5SneqGXrCJMR9bq5AL0aWgPlNMhO5Wofcheeil89NKkRZb+zCj En/A2V4b0rZI/XXjproFzX42/AYJMTDzLfxp2mmc4CmBZWff3TbiVMthJNsX0IG7cjp+ pw9HacOmZnvy4SpVXnzTOxEDdbNnKi6kPYrruLaujalvHMA7KILcldsYcdbMdjd+k/nO 35daa0dKrC+pjLhaJDIl3U5GkFL7vs36h9SNvklU1c9sWipUtPbPzL/KKU/eR+EavgYY Zi/oRUSlP2+F9BFJVgy6ndX/i5AGD1ykmNBVtGZqJSMzc4zK++BNoC0KaVMMbrED+thj qRUg== X-Received: by 10.112.147.170 with SMTP id tl10mr1656061lbb.100.1365616252822; Wed, 10 Apr 2013 10:50:52 -0700 (PDT) Received: from patrik-desktop.lan (h138n8-oer-a32.ias.bredband.telia.com. [2.248.103.138]) by mx.google.com with ESMTPS id iq6sm309626lab.10.2013.04.10.10.50.52 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Apr 2013 10:50:52 -0700 (PDT) From: Patrik Jakobsson To: dri-devel@lists.freedesktop.org Subject: [PATCH 02/15] drivers: gpu: drm: gma500: Replaced calls kzalloc & memcpy with kmemdup Date: Wed, 10 Apr 2013 19:49:47 +0200 Message-Id: <1365616200-26312-3-git-send-email-patrik.r.jakobsson@gmail.com> X-Mailer: git-send-email 1.7.10.4 Cc: Alexandru Gheorghiu X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Alexandru Gheorghiu Replaced calls kzalloc followed by memcpy with call to kmemdup. Patch found using coccinelle. Signed-off-by: Alexandru Gheorghiu Signed-off-by: Patrik Jakobsson --- drivers/gpu/drm/gma500/intel_bios.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/gma500/intel_bios.c b/drivers/gpu/drm/gma500/intel_bios.c index 403fffb..d349734 100644 --- a/drivers/gpu/drm/gma500/intel_bios.c +++ b/drivers/gpu/drm/gma500/intel_bios.c @@ -218,12 +218,11 @@ static void parse_backlight_data(struct drm_psb_private *dev_priv, bl_start = find_section(bdb, BDB_LVDS_BACKLIGHT); vbt_lvds_bl = (struct bdb_lvds_backlight *)(bl_start + 1) + p_type; - lvds_bl = kzalloc(sizeof(*vbt_lvds_bl), GFP_KERNEL); + lvds_bl = kmemdup(vbt_lvds_bl, sizeof(*vbt_lvds_bl), GFP_KERNEL); if (!lvds_bl) { dev_err(dev_priv->dev->dev, "out of memory for backlight data\n"); return; } - memcpy(lvds_bl, vbt_lvds_bl, sizeof(*vbt_lvds_bl)); dev_priv->lvds_bl = lvds_bl; }