Received: by 10.213.65.68 with SMTP id h4csp965695imn; Wed, 14 Mar 2018 05:48:57 -0700 (PDT) X-Google-Smtp-Source: AG47ELu2kgplgum56U9YNLebgEjRtHIL26pdiYMfZwicbYuKnjaE96w7VyBoleucY6g1Y0aP+zYR X-Received: by 10.99.96.84 with SMTP id u81mr3601998pgb.231.1521031737908; Wed, 14 Mar 2018 05:48:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521031737; cv=none; d=google.com; s=arc-20160816; b=OhK8Ro5zSZKl93TcYkGQRgSQedDXCXwDF4rmF7s3nPdSSzSBTSN/xjfxAWPvoCLJ24 ptyiPslcqznVba/mmdRPZKLicv0A0wSlW3Pmeae04aqCKk5+7BfwJUh2w3GgmpUao8kP yDs8w4IaxYl+h90E9N2xzXxO/sGuc1WQFjVNqOZ0N+oCNU22jRBEInNBlQBfya8D1bp2 +OH/XPaN4p7lqNUcSYebGuSIAtfvGPsZWig2xWX3RPhsg1O0mN5c6o9sqT55ZjpxY+Q5 7c7wH8iIdnzToxWw8j5+RqU4aQLEfyFL9CGXqVn/yGew+XYMFH0F5ZGKsNAfZ7lXcIz4 Py9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=X3wyjJMi6kk7rg04JRPZeD+yK3TPTnJlYU/fBWqfdlY=; b=dfxv+QnFfjVtK894utly0rGL5HUz0jXSLnrWcPluu3XsxC5s2LRijq2mq6G7y1sdov yv/R+3BqUMgQVrQ5nz70iGdvVoo7GUl6ODVbw8LvwYVbNKN+C6J20snoKF6t/X4DC8SX bvddO7wimsgLOGG/06NRLpRG87oUhRc6RGIbjfhLLcumgMEOkajRz/ZDYposVr870UCc E+1wuxggPSPM/L+hAEoYo7g6mwu1MRG1FBi8Qay9Q3orL0sdYqO+WAvdq6iH5QgCIVZ1 MYEPhEftpDNtoGpyeD1IImzR1q9ON38w46NvIxHl/GjFADAKkYL0ZzjwVkr2zDR+m/9k Jy/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e+SJGr6f; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v126si1231381pgb.340.2018.03.14.05.48.43; Wed, 14 Mar 2018 05:48:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e+SJGr6f; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752108AbeCNMph (ORCPT + 99 others); Wed, 14 Mar 2018 08:45:37 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:39117 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751470AbeCNMpe (ORCPT ); Wed, 14 Mar 2018 08:45:34 -0400 Received: by mail-pl0-f67.google.com with SMTP id k22-v6so790515pls.6; Wed, 14 Mar 2018 05:45:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=X3wyjJMi6kk7rg04JRPZeD+yK3TPTnJlYU/fBWqfdlY=; b=e+SJGr6fvSeBrYkVX09q98ChJnCw0Oxgvqr4NeCKH2qT1WisivCeptIRuwCkRZCxFt oDm3rTOwlLc9nHNA3LXxIWqOPO+uDXGuBnMxAFuVxqIK+SVi9ffSce+gbqoh8OLSxVmM TjoMyF9uRehgwSi2WP2QJHTYCOOmdNqQAY8hDFsF6Evv2TEhpVg1eoi6JRa9LEeawZT3 QlqVnoEKNjA42VyplPkCnjoMuLSm1XDyvUVELVlhWgSfE4mR5MS92VPkyHl5moQ45H3v o7fFIAnHlhet0mIKNgabp1iU7BW0+Xd1ethpPrYwuECB8WBX7G5QFtZMI2H2AqwA1Nfc mnfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=X3wyjJMi6kk7rg04JRPZeD+yK3TPTnJlYU/fBWqfdlY=; b=e/qcxFCt03UeQtQScSr9AB9+i34+gv2zwmQeKpEJdX9AM+/4hD0zKDukn0NuU2C1H4 2LJ3iwC6vC3pP3i8IpgWxs3JnkO3dyO1NdxVdh+J3hF/AGzA2pjcbsawqBpMr18lPlJe 8YalXF3PVFarAfDdWLwetRunDg02qsJxo7ZDBYlJs0GE5EzNL+lFfzU15Cle46H3aKfT 2hKt9BTdhgraBLDbpivcShuH0sSF1wshCBZAo84WHSQcDeMZD0rl0QB4E3sElgHnWVbx 02SxgzsUpMeLmuUb3KRPnTk/+3hiwnO/Be8RWN0utYj/YjFGI9EbpmZ5uyDJ8HzjKA2B 0cDw== X-Gm-Message-State: AElRT7HRh+APWiY0/pwwexhx944zivVIb/nDrniTM2CCFYDoooM4ZFvC NmiaEakrwzzER+AJejzHrSo= X-Received: by 2002:a17:902:f64:: with SMTP id 91-v6mr4003775ply.232.1521031533740; Wed, 14 Mar 2018 05:45:33 -0700 (PDT) Received: from localhost.localdomain ([2405:204:7142:9212:3d49:8166:4647:f07f]) by smtp.gmail.com with ESMTPSA id y14sm3999982pff.81.2018.03.14.05.45.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Mar 2018 05:45:32 -0700 (PDT) From: hariprasath.elango@gmail.com To: aditya.shankar@microchip.com, gregkh@linuxfoundation.org, ganesh.krishna@microchip.com Cc: hariprasath.elango@gmail.com, linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/7] staging: wilc1000: use kmemdup instead of kmalloc and memcpy Date: Wed, 14 Mar 2018 18:15:01 +0530 Message-Id: X-Mailer: git-send-email 2.10.0.GIT In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: HariPrasath Elango Kmalloc followed by memcpy can be replaced by kmemdup. Signed-off-by: HariPrasath Elango Reviewed-by: Ajay Singh --- drivers/staging/wilc1000/linux_mon.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index f93f411..c6fd6b3 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -146,7 +146,7 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len) if (!mgmt_tx) return -ENOMEM; - mgmt_tx->buff = kmalloc(len, GFP_ATOMIC); + mgmt_tx->buff = kmemdup(buf, len, GFP_ATOMIC); if (!mgmt_tx->buff) { kfree(mgmt_tx); return -ENOMEM; @@ -154,7 +154,6 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len) mgmt_tx->size = len; - memcpy(mgmt_tx->buff, buf, len); wilc_wlan_txq_add_mgmt_pkt(dev, mgmt_tx, mgmt_tx->buff, mgmt_tx->size, mgmt_tx_complete); -- 2.10.0.GIT