From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B41F6C43382 for ; Fri, 28 Sep 2018 17:31:43 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3246B20676 for ; Fri, 28 Sep 2018 17:31:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="nNLgp1uv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3246B20676 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42MJd83569zF3JN for ; Sat, 29 Sep 2018 03:31:40 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="nNLgp1uv"; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=helgaas@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="nNLgp1uv"; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42MJZJ0JQTzF3F6 for ; Sat, 29 Sep 2018 03:29:11 +1000 (AEST) Received: from localhost (unknown [150.199.191.185]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DA51920676; Fri, 28 Sep 2018 17:29:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1538155750; bh=r/HdSEm7R/7XHlstSZRNEVe/0ggNLHGbkUGPRLVzgKQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nNLgp1uvx2l2G2s/akq505ufQd+szmzobUAA6nCy26GSrZ7RivTo4Yx7xY9lGFutu ZwEt3ndtzYmP3NC4nYq5wOBtpJAsBKe/6B2LBLpkAnMx09MoSlHxeqTkXdNFLN/gtr kEihS2p+ul4liKOS0Hy7MO7cDj1fAHdcRa+7PlfU= Date: Fri, 28 Sep 2018 12:29:08 -0500 From: Bjorn Helgaas To: YueHaibing Subject: Re: [PATCH -next] PCI: hotplug: Use kmemdup rather than duplicating its implementation in pnv_php_add_devtree() Message-ID: <20180928172908.GC18434@bhelgaas-glaptop.roam.corp.google.com> References: <1538031141-138417-1-git-send-email-yuehaibing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1538031141-138417-1-git-send-email-yuehaibing@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, Paul Mackerras , linux-pci@vger.kernel.org, Bjorn Helgaas , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Thu, Sep 27, 2018 at 06:52:21AM +0000, YueHaibing wrote: > Use kmemdup rather than duplicating its implementation > > Signed-off-by: YueHaibing Applied with Michael's ack to pci/hotplug for v4.20, thanks! > --- > drivers/pci/hotplug/pnv_php.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c > index 5070620..ee54f5b 100644 > --- a/drivers/pci/hotplug/pnv_php.c > +++ b/drivers/pci/hotplug/pnv_php.c > @@ -275,14 +275,13 @@ static int pnv_php_add_devtree(struct pnv_php_slot *php_slot) > goto free_fdt1; > } > > - fdt = kzalloc(fdt_totalsize(fdt1), GFP_KERNEL); > + fdt = kmemdup(fdt1, fdt_totalsize(fdt1), GFP_KERNEL); > if (!fdt) { > ret = -ENOMEM; > goto free_fdt1; > } > > /* Unflatten device tree blob */ > - memcpy(fdt, fdt1, fdt_totalsize(fdt1)); > dt = of_fdt_unflatten_tree(fdt, php_slot->dn, NULL); > if (!dt) { > ret = -EINVAL; > > >