Received: by 10.213.65.68 with SMTP id h4csp226571imn; Thu, 5 Apr 2018 22:09:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+2SdSPNJ1KtCI/7Ly7IVQDgJ65MwdiUnMBYSPHWiWJsTSFR2Jx8/xJsancJW2gDGTbng1Q X-Received: by 2002:a17:902:ac1:: with SMTP id 59-v6mr19190336plp.367.1522991343308; Thu, 05 Apr 2018 22:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522991343; cv=none; d=google.com; s=arc-20160816; b=mzwuVhQVn6Vlcp7NVvMzeXPpqjLuycCG8sX+wcIhQhdRhoEUa26e5JfUQcTcUDS1Af YqgDy9fbVc3yqa46Kv8PqCNTmsjqaddvVYFHpAlU5nJ4tuKftqD26OXnZ8HKkEPAhZF0 JyZHMFRUi/ISpM56OCxJkrkAxsz6k/9rq9HBWNVXtWJQV09tx+d6quGkPQXqKJmSdMpz WXdnPgmxKb4PgNV8P9+rQDtgdQqWZOdzHi2rKgXiq1WxdDkW9MdxpRj1rZad4Z8IFQVa zxEDQKZBTPmm8xwE4sN0kUikeumuyAj/QWHmMtG3GROzH5AOB1Xpe7PY8pXSCUjDHT9z ySyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=umVPonmx8hCPX1LF2yA9AChn87h2q0zhKcxt8oIyUCM=; b=NbOjD6XDXsU8H+82O0nyl9LSvFPWU12Kdw8riRinf5O7vhcFSmpQEja7AE0inH5cjR PCCkGs0+HcK2yCOrJ3JaJEnn/Up81cjWQJlK0okjRf+KqfMWRX9Z/W957lFN6b82QVm1 WbDhptef8pO5P6FvtgJ093F+VBzFS1uoFSdsJn3x8ctefFK/zoXOdT09K67oEnDJ59nc uNFrYiea99IViTmWcD0AuiYXTXM/cdYXRY+/TNuvP2S6A5NTsvlKo/IDR/uH3rPDGQdw l1c1UZVdnMsEYq0KW7yn/NcWA6HiSCxa/Bdo47bVYu3oNM6+aviVxSmRHbbsTENQv7Ii 7eBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=VmxKYAhn; 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=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m1-v6si9996741plt.363.2018.04.05.22.08.49; Thu, 05 Apr 2018 22:09:03 -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=@samsung.com header.s=mail20170921 header.b=VmxKYAhn; 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=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751532AbeDFE5q (ORCPT + 99 others); Fri, 6 Apr 2018 00:57:46 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:56324 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750882AbeDFE5o (ORCPT ); Fri, 6 Apr 2018 00:57:44 -0400 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20180406045743epoutp04e1c7bf3d7be956b8f5dc1d9e27bb4dbc~iv-BdFavl0707107071epoutp04E; Fri, 6 Apr 2018 04:57:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20180406045743epoutp04e1c7bf3d7be956b8f5dc1d9e27bb4dbc~iv-BdFavl0707107071epoutp04E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1522990663; bh=umVPonmx8hCPX1LF2yA9AChn87h2q0zhKcxt8oIyUCM=; h=From:To:Cc:Subject:Date:References:From; b=VmxKYAhneB17oHlOZTmhUYBNhR7fP4PLXit+7ok+i1I+0XzyU9up7i3+AI5VlsSd+ kqIK2wqUszET9/mzhqH/OLB2OhMBxD1/wcSyFHM7UfvE3rB8INEXCmURz7hwHP4jcE 4DjUMfWdl5LAgxdlq1zw0mz/iBAv4T6O7GvF/CKI= Received: from epsmges1p4.samsung.com (unknown [182.195.40.61]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20180406045742epcas1p3dcbd6ae59ebc4a4b7fc8656f8abfc3b6~iv-A-JOff1150911509epcas1p34; Fri, 6 Apr 2018 04:57:42 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id A3.26.04226.64EF6CA5; Fri, 6 Apr 2018 13:57:42 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20180406045742epcas1p22ad1bad680b9526a81c7371b75ac1f1e~iv-An6uez1329213292epcas1p2v; Fri, 6 Apr 2018 04:57:42 +0000 (GMT) X-AuditID: b6c32a38-d5bff70000001082-eb-5ac6fe46b322 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id F8.F5.03849.64EF6CA5; Fri, 6 Apr 2018 13:57:42 +0900 (KST) Received: from localhost.localdomain ([10.253.107.61]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P6Q00DH6Z41B940@mmp2.samsung.com>; Fri, 06 Apr 2018 13:57:41 +0900 (KST) From: Ji-Hun Kim To: gregkh@linuxfoundation.org Cc: me@tobin.cc, sergio.paracuellos@gmail.com, quytelda@tamalin.org, dan.carpenter@oracle.com, y.k.oh@samsung.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Ji-Hun Kim Subject: [PATCH] staging: ks7010: replace kmalloc() + memcpy() with kmemdup() Date: Fri, 06 Apr 2018 13:57:20 +0900 Message-id: <1522990640-30706-1-git-send-email-ji_hun.kim@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCKsWRmVeSWpSXmKPExsWy7bCmvq7bv2NRBmdPKlq8/jedxWLPmV/s Fs2L17NZ9J/ezmix9Za0xeVdc9gsbrcdY7V4dHYWk8WlNf4WW7p+sDpwedzbd5jFY+esu+we ++euYff4+PQWi0ffllWMHv9OMXl8uf6a0ePzJrkAjqhUm4zUxJTUIoXUvOT8lMy8dFsl7+B4 53hTMwNDXUNLC3MlhbzE3FRbJRefAF23zBygC5UUyhJzSoFCAYnFxUr6djZF+aUlqQoZ+cUl tkrRhoZGeoYG5npGRkZ6JuaxVkamQCUJqRlX7l1iLPjIVrFr63/2BsbXrF2MnBwSAiYSDV9W MXUxcnEICexglJhx4DOU851RYsGphSwwVV/XrQfrEBLYwCgxu0EFwv7BKHHwnTeIzSagKbGx +xojiC0iICfx5PYfZhCbGWTQ3fcmILawgL/En6032EBsFgFVieWnf4DV8Aq4Scy4ch1ql5zE yWOTWUGOkBCYwSbR/GAmE0TCRWL+9wtQtrDEq+Nb2LsYOYBsaYlLR20hwtUSC67sgJpTI3Hz /1KocmOJ3p4LUPfwSbz72sMK0cor0dEmBFHiIXFk0XtmCNtRYuvO6cwQL8ZKTDp9lX0Co+QC RoZVjGKpBcW56anFhgUmesWJucWleel6yfm5mxjBKUbLYgfjnnM+hxgFOBiVeHgzIo5FCbEm lhVX5h5ilOBgVhLh3f0HKMSbklhZlVqUH19UmpNafIjRFBgaE5mlRJPzgekvryTe0MTSwMTM yNTU0MDCREmcNyDAJUpIID2xJDU7NbUgtQimj4mDU6qB0W3Ts4df1iSXvd0taHtm4d83Jgau Bj+C3+m8+ZHxb/6Eypubcmp8VwtPbDG6nFzffubysctzzmVNU5+a8fuoqsKbCZJ934VrP68/ dTSn5Ly2f++qvQ5sl3iqXQLn6a1pkzCsL4g5f+aaf7bIbN93H7/vmr563ez8wkPzpZhtw3dt evGT7QD3HTclluKMREMt5qLiRACEzSDRRwMAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnluLIzCtJLcpLzFFi42I5/e+xoK7bv2NRBk97OS1e/5vOYrHnzC92 i+bF69ks+k9vZ7TYekva4vKuOWwWt9uOsVo8OjuLyeLSGn+LLV0/WB24PO7tO8zisXPWXXaP /XPXsHt8fHqLxaNvyypGj3+nmDy+XH/N6PF5k1wARxSXTUpqTmZZapG+XQJXxpV7lxgLPrJV 7Nr6n72B8TVrFyMnh4SAicTXdeuBbC4OIYF1jBJz391khnB+MEpM2r2CBaSKTUBTYmP3NUYQ W0RATuLJ7T/MIDazwHdGiferweLCAr4SE05MA5vKIqAqsfz0D7AaXgE3iRlXrrNAbJOTOHls MusERq4FjAyrGCVTC4pz03OLjQoM81LL9YoTc4tL89L1kvNzNzECg2nbYa2+HYz3l8QfYhTg YFTi4c2IOBYlxJpYVlyZe4hRgoNZSYR39x+gEG9KYmVValF+fFFpTmrxIUZpDhYlcd7becci hQTSE0tSs1NTC1KLYLJMHJxSDYzmL7rXTj1UdvSajrSR9bFzd49/NNaf+eLjxd0uwk/zTJbM MO64MOuk81y7mZqvlkavzLMovrE6sjDi3vmdB73LH+moaMY5tV9zOP38T/Leguk78o4GPlp5 UsJhVZHPlQafQ3s9LU1mbLY1tq2P4uwRSNpSr5k8898G1ekW9VbsL0oy2PParkYosRRnJBpq MRcVJwIArfqvFiICAAA= X-CMS-MailID: 20180406045742epcas1p22ad1bad680b9526a81c7371b75ac1f1e X-Msg-Generator: CA CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20180406045742epcas1p22ad1bad680b9526a81c7371b75ac1f1e X-RootMTR: 20180406045742epcas1p22ad1bad680b9526a81c7371b75ac1f1e References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use kmemdup rather than duplicating its implementation. Signed-off-by: Ji-Hun Kim --- drivers/staging/ks7010/ks7010_sdio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index b8f55a1..c8eb55b 100644 --- a/drivers/staging/ks7010/ks7010_sdio.c +++ b/drivers/staging/ks7010/ks7010_sdio.c @@ -589,11 +589,10 @@ static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index) int ret; unsigned char *data_buf; - data_buf = kmalloc(sizeof(u32), GFP_KERNEL); + data_buf = kmemdup(&index, sizeof(u32), GFP_KERNEL); if (!data_buf) return -ENOMEM; - memcpy(data_buf, &index, sizeof(index)); ret = ks7010_sdio_write(priv, WRITE_INDEX, data_buf, sizeof(index)); if (ret) goto err_free_data_buf; -- 1.9.1