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=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 EE7EDC4332F for ; Sun, 8 Sep 2019 09:29:40 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 C8C0220863 for ; Sun, 8 Sep 2019 09:29:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C8C0220863 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=osuosl.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8C1668578B; Sun, 8 Sep 2019 09:29:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LHfMi_vtSuAN; Sun, 8 Sep 2019 09:29:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 61D018567A; Sun, 8 Sep 2019 09:29:36 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 07D171BF584 for ; Sun, 8 Sep 2019 09:29:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 01FDC855D2 for ; Sun, 8 Sep 2019 09:29:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HBJSFqMAhQRw for ; Sun, 8 Sep 2019 09:29:33 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by whitealder.osuosl.org (Postfix) with ESMTPS id A028A856ED for ; Sun, 8 Sep 2019 09:29:33 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id 4so5195958pld.10 for ; Sun, 08 Sep 2019 02:29:33 -0700 (PDT) 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; bh=KqmU2B1xYvdru8ogR2pq8XGCUpBnZO9sYgiPNZNgnlM=; b=Dv2szI+nK08RrUKZpmFm5+hrQbeDE5Ey4eXxX5/RTcIE2QjgdiXJOli8W8s5rmCcO9 pfLThg+zci1Nlec0VJYBNSclUgACJCJwuiZOhGc9z5v9mes//DaZ5vbQQMPwR0+kr0j5 5DqlLd8SB98t2y99guUuM7/aGKmyawAoUJyba0a/9Y+LGcHVYoW/xMNBtqLTwQXQYC9C ph6ihKTMolhT946KXZlX03o1+/X7qldkDFrKFKlX4xU38oh6Sa3HnK5kfxN5FAFOjNCt zxsx7LE9ii6SsEUhsCD60lyfO0u/0HLP4IRcKiporY+rADIMRUA73xi1SuIiqgYeNeN4 07rA== X-Gm-Message-State: APjAAAV579XosUDruLCncvCFJRUnBaDanWn5lI7/IvsH+ogACYxmjXxV FRNaTrGgfSEBU+KsJERc8QU= X-Google-Smtp-Source: APXvYqzB5+/7GI+abtTsCznMkS20Y9f6IC275mCV8QrPFI0i4UMKqVXvDxVXd44lSAVrvQRTXzzndg== X-Received: by 2002:a17:902:20c9:: with SMTP id v9mr17850544plg.293.1567934973254; Sun, 08 Sep 2019 02:29:33 -0700 (PDT) Received: from localhost.localdomain ([183.83.88.189]) by smtp.gmail.com with ESMTPSA id t12sm12782412pfe.58.2019.09.08.02.29.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 Sep 2019 02:29:32 -0700 (PDT) From: hariprasad@osuosl.org, Kelam@osuosl.org, hariprasad.kelam@gmail.com To: Subject: [PATCH] staging: exfat: make use of kmemdup Date: Sun, 8 Sep 2019 14:58:41 +0530 Message-Id: <1567934921-6475-1-git-send-email-hariprasad.kelam@gmail.com> X-Mailer: git-send-email 2.7.4 X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, Greg Kroah-Hartman , Hariprasad Kelam , Valdis Kletnieks , linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" From: Hariprasad Kelam fix below issue reported by coccicheck drivers/staging//exfat/exfat_super.c:2709:26-33: WARNING opportunity for kmemdup Signed-off-by: Hariprasad Kelam --- drivers/staging/exfat/exfat_super.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c index 280bf0d..3db4b6a 100644 --- a/drivers/staging/exfat/exfat_super.c +++ b/drivers/staging/exfat/exfat_super.c @@ -2706,12 +2706,11 @@ static int exfat_symlink(struct inode *dir, struct dentry *dentry, inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); /* timestamp is already written, so mark_inode_dirty() is unneeded. */ - EXFAT_I(inode)->target = kmalloc(len+1, GFP_KERNEL); + EXFAT_I(inode)->target = kmemdup(target, len + 1, GFP_KERNEL); if (!EXFAT_I(inode)->target) { err = -ENOMEM; goto out; } - memcpy(EXFAT_I(inode)->target, target, len+1); dentry->d_time = GET_IVERSION(dentry->d_parent->d_inode); d_instantiate(dentry, inode); -- 2.7.4 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel