Received: by 10.192.165.148 with SMTP id m20csp4907048imm; Tue, 8 May 2018 17:14:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpOvU9pgGURkU+KEZWa1Joex3DNW8/HFqQ/VlD/Hcs289alLL9ZETR2qWKhgC6PUgMfEpzk X-Received: by 2002:a17:902:8a82:: with SMTP id p2-v6mr8927832plo.244.1525824841651; Tue, 08 May 2018 17:14:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525824841; cv=none; d=google.com; s=arc-20160816; b=E+hIwgyw8KCUDYbAepU2TffKNi8ayejbas7voL1xcwEnl3hyEIrd7Puaklo6FtzRf7 mbDQXOPoslo9vPEzZPXMf9aG3eF3nWRnNA5lVEkUPTy1hoTOW13jp0x/m2MpeJc/SrJR fwvmFnLsmckUdqk4pJEx1nCt/O6iKwSqDASMOfTUs7HBLm3rmusyYZsdE/5Oo9CF/COW KMDJB4vRpv8M0VVXs0r2z7x1DCMkQrtzGandydirjArugbZnbKptH3bEszAdJTXn7ya5 ZhufGmjta8ULqbb6zk/1kLFSzTz7bApWjbJfxJNjgynR1Aw6AsK9n0Llh4rd4DqppTiM iHXA== 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 :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :dkim-filter:arc-authentication-results; bh=VwXmao9gFIFoQK48udxebBeoZLVQLnIbsEdEoxxCrXI=; b=rd7XZ0InHJBIYRbTKqtCcTypGpM++xPYMHsqeRGdQ8V8e0frpC+uH+BLPywragL0pS +jpHn7G2heWP7R5/U3x/9NEdW+APLXKGRfpCNKxdjHEIaw4n3gV2Sc93A72418ypw+T5 pGGQ+WyqwxLBxvj8veC2CMsTGAyPpf5f5Pfd8DZUU53rsbNJFz2NMVeb69sdo39YqZbx /vXCZDkt7fQNkoNYgonF2B7283vIOQAQa1uuTnRATzRN2eMjLtRJLt4iPNpafan6ej4k jYCPBnH0C73KHpOfwkVyAtVisLpsNYHlkQACuxz18KerV/vTXymqmGWLycIav/mQIcGn FH5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=LWmYPT2c; 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 t14-v6si20330467pgf.93.2018.05.08.17.13.40; Tue, 08 May 2018 17:14:01 -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=LWmYPT2c; 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 S933261AbeEIANH (ORCPT + 99 others); Tue, 8 May 2018 20:13:07 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:12893 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932593AbeEIAND (ORCPT ); Tue, 8 May 2018 20:13:03 -0400 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20180509001301epoutp020db2fefeb5c446b161fc871ff601c335~s0Y3215Pt2755027550epoutp02s; Wed, 9 May 2018 00:13:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20180509001301epoutp020db2fefeb5c446b161fc871ff601c335~s0Y3215Pt2755027550epoutp02s DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1525824781; bh=VwXmao9gFIFoQK48udxebBeoZLVQLnIbsEdEoxxCrXI=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=LWmYPT2c2WTYUmMJ8Cn7/v/INUt2zStwH0ZEoq8VoA+lp0Sygx9sTgLwroBVgLRo4 NTleMKYri0QXAPXyHXRJ+53uLqSD0O0ME/sFc/1ybGr4KggcoFyyqUcmd8/0DSVmUt yZwWz8/DLrtVoq3of6QOYfLO1Ubz9Xmxe4cCgD7g= Received: from epsmges2p1.samsung.com (unknown [182.195.40.163]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20180509001300epcas1p3a2e1efa60ae82535d8113c45a09f0b47~s0Y3LaWGO2706127061epcas1p34; Wed, 9 May 2018 00:13:00 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id FC.FB.04128.C0D32FA5; Wed, 9 May 2018 09:13:00 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20180509001300epcas2p3971900d48408aef6a80f59b9480aac16~s0Y2n0NVl1145011450epcas2p3U; Wed, 9 May 2018 00:13:00 +0000 (GMT) X-AuditID: b6c32a45-8f3ff70000001020-fc-5af23d0c00ae Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 61.90.03817.B0D32FA5; Wed, 9 May 2018 09:13:00 +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 <0P8F008EBPX9TR40@mmp2.samsung.com>; Wed, 09 May 2018 09:12:59 +0900 (KST) From: Ji-Hun Kim To: peterhuewe@gmx.de, tweek@google.com Cc: jarkko.sakkinen@linux.intel.com, jgg@ziepe.ca, arnd@arndb.de, gregkh@linuxfoundation.org, javierm@redhat.com, sonnyrao@chromium.org, ji_hun.kim@samsung.com, enric.balletbo@collabora.com, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 2/2] tpm: replace kmalloc() + memcpy() with kmemdup() Date: Wed, 09 May 2018 09:12:37 +0900 Message-id: <1525824757-21835-2-git-send-email-ji_hun.kim@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1525824757-21835-1-git-send-email-ji_hun.kim@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHKsWRmVeSWpSXmKPExsWy7bCmmS6P7acog98flC3+TjrGbrHm9iFG i+bF69ksvq9ysVg4bTmjxcwZJxgt+k9vZ7TYekva4sQ5oKrLu+awWbzd95Pd4smZmYwW8371 Mjnwevz+NYnRY3bDRRaPHXeXMHp8+BjnsWBTqce8k4Ee++euYfd4v+8qm0ffllWMHp83yXls /XybJYA7KtUmIzUxJbVIITUvOT8lMy/dVsk7ON453tTMwFDX0NLCXEkhLzE31VbJxSdA1y0z B+h6JYWyxJxSoFBAYnGxkr6dTVF+aUmqQkZ+cYmtUrShoZGeoYG5npERkDaPtTIyBSpJSM04 dfEka8EVtoqui3eZGxivsXYxcnJICJhIfNm6g62LkYtDSGAHo8Smi7MYIZzvjBI9Hw+zwVSt efWWHcQWEtjAKNG5zRmi6AejxPOFf5lBEmwCmhIbu68xgtgiAuoSEyafZAIpYhZYyiSx4chZ oEkcHMICrhJdSzVATBYBVYn12yRBynkF3CRmHFjCDrFLTuLksclg13EKuEs8m/Mf7DoJgfts Elu6vzNBFLlIrOnZA/WCsMSr41ugmqUlnq3ayAhhV0ssuLKDBcKukbj5fylUr7FEb88FsJuZ BfgkOg7/ZQe5R0KAV6KjTQiixENi9/H/UL87SrQt3QoNoVmMEh3Hr7JPYJRawMiwilEstaA4 Nz212KjAUK84Mbe4NC9dLzk/dxMjOG1pue5gnHHO5xCjAAejEg+vxM6PUUKsiWXFlbm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ff3ZG23BklevqL35mTuTbcICTp8aT5/DZr+PmB1rkDugxFKckWioxVxU nAgAs+xtIlUCAAA= X-CMS-MailID: 20180509001300epcas2p3971900d48408aef6a80f59b9480aac16 X-Msg-Generator: CA CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20180509001300epcas2p3971900d48408aef6a80f59b9480aac16 X-RootMTR: 20180509001300epcas2p3971900d48408aef6a80f59b9480aac16 References: <1525824757-21835-1-git-send-email-ji_hun.kim@samsung.com> 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/char/tpm/eventlog/efi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/char/tpm/eventlog/efi.c b/drivers/char/tpm/eventlog/efi.c index 68f1e7e..3e673ab 100644 --- a/drivers/char/tpm/eventlog/efi.c +++ b/drivers/char/tpm/eventlog/efi.c @@ -51,10 +51,9 @@ int tpm_read_log_efi(struct tpm_chip *chip) } /* malloc EventLog space */ - log->bios_event_log = kmalloc(log_size, GFP_KERNEL); + log->bios_event_log = kmemdup(log_tbl->log, log_size, GFP_KERNEL); if (!log->bios_event_log) goto err_memunmap; - memcpy(log->bios_event_log, log_tbl->log, log_size); log->bios_event_log_end = log->bios_event_log + log_size; tpm_log_version = log_tbl->version; -- 1.9.1