Received: by 10.192.165.148 with SMTP id m20csp1570793imm; Sat, 28 Apr 2018 00:24:41 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpVpotrPkw8ktv5JqKI3+kIM8l8VYbN/FzUtOv7kzLDfykWbX6+OE4Q8HuwgMBcaRBG79Ww X-Received: by 2002:a17:902:a586:: with SMTP id az6-v6mr5094858plb.210.1524900281187; Sat, 28 Apr 2018 00:24:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524900281; cv=none; d=google.com; s=arc-20160816; b=T8156HZuV6G9qri7SLr+S1Bh4p4MgO5RlFMF39nDUk7dhmQTdrKLR3r7ajpRlmjVH8 9Aj33MmdrBhdLfi/rxyM4+mD6BV0w3MxL5IwHMCnjtlW68Rk7iab+Vbzq5/4Yi1usuhj 77kdu1xaHVLRKXiXDWD1EDMOKajo/TxmuLtz/aBnwx2AgZi69irlEWV9VU6xVjiEPi3T h5WRjLRfReFOCQvdEpe1O8b5l3rNElK97IfLgYhzTnGidxcu2qQGBqv9XS7PC9VdAqCR PRjyYOFaFgo5X8QBDkxCTLccasTjZixZIjuzQz+eTZL3uqQAmc2Uc/7YHVw8hpLBBcb+ 15pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :subject:cc:to:from:date:arc-authentication-results; bh=yuke70q8wEYq6OZcGP1Wd3JHUAYYwjMbZn3ph4DEFwo=; b=MFem+4eA3Rj/4ntgHFF1KQ1vLX2/6r7anHKyeqeBhytYFKP83MY4V1gqeKG4WLOxrf iIcevE5AKE9RiBMVhdzZCJimIb28B5zT9hejuHfsO1Dxsim+2bTLqodZpz/8EQRRrJgf Ds/Uan76yqzIqxn+FVsXfz3yS2BRp45mqWUme/bVf6IWoRfrclwzgWOqrZWRy0+glhfU hYmpvqmgrehCp/YYoxyXjS9FFuBhwvrcpJxKWOaElBLoxDWo/nKXZwzm9sW/754ExBtl zw0G5s2InTPb5bdsszOoVUI38cyzQ6Ij8gJy9u4iEOT0Oo68/Dj9HkNuCr3/iEswSGkq d3sg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b7-v6si2680491pgv.279.2018.04.28.00.24.27; Sat, 28 Apr 2018 00:24:41 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933429AbeD1HXV (ORCPT + 99 others); Sat, 28 Apr 2018 03:23:21 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:6691 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752688AbeD1HXV (ORCPT ); Sat, 28 Apr 2018 03:23:21 -0400 X-IronPort-AV: E=Sophos;i="5.49,338,1520895600"; d="scan'208";a="324880493" Received: from 85-171-61-52.rev.numericable.fr (HELO [192.168.0.15]) ([85.171.61.52]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Apr 2018 09:23:19 +0200 Date: Sat, 28 Apr 2018 09:23:19 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Sujeev Dias cc: Greg Kroah-Hartman , Arnd Bergmann , Sujeev Dias , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Tony Truong , kbuild-all@01.org Subject: [PATCH] mhi_bus: core: fix memdup.cocci warnings Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fengguang Wu Use kmemdup rather than duplicating its implementation Generated by: scripts/coccinelle/api/memdup.cocci Fixes: ec8245f7a36f ("mhi_bus: core: Add support for MHI host interface") CC: Sujeev Dias Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- url: https://github.com/0day-ci/linux/commits/Sujeev-Dias/mhi_bus-core-Add-support-for-MHI-host-interface/20180428-065959 :::::: branch date: 3 hours ago :::::: commit date: 3 hours ago mhi_boot.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/bus/mhi/core/mhi_boot.c +++ b/drivers/bus/mhi/core/mhi_boot.c @@ -504,7 +504,7 @@ void mhi_fw_load_worker(struct work_stru if (size > firmware->size) size = firmware->size; - buf = kmalloc(size, GFP_KERNEL); + buf = kmemdup(firmware->data, size, GFP_KERNEL); if (!buf) { MHI_ERR("Could not allocate memory for image\n"); release_firmware(firmware); @@ -512,7 +512,6 @@ void mhi_fw_load_worker(struct work_stru } /* load sbl image */ - memcpy(buf, firmware->data, size); ret = mhi_fw_load_sbl(mhi_cntrl, buf, size); kfree(buf);