DriverDev-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] staging: exfat: make use of kmemdup
@ 2019-09-08  9:28 hariprasad, Kelam, hariprasad.kelam
  2019-09-08 13:05 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: hariprasad, Kelam, hariprasad.kelam @ 2019-09-08  9:28 UTC (permalink / raw)
  Cc: devel, Greg Kroah-Hartman, Hariprasad Kelam, Valdis Kletnieks,
	linux-kernel

From: Hariprasad Kelam <hariprasad.kelam@gmail.com>

fix below issue reported by coccicheck
drivers/staging//exfat/exfat_super.c:2709:26-33: WARNING opportunity for
kmemdup

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
---
 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: exfat: make use of kmemdup
  2019-09-08  9:28 [PATCH] staging: exfat: make use of kmemdup hariprasad, Kelam, hariprasad.kelam
@ 2019-09-08 13:05 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2019-09-08 13:05 UTC (permalink / raw)
  To: hariprasad, Kelam, hariprasad.kelam; +Cc: devel, Valdis Kletnieks, linux-kernel

On Sun, Sep 08, 2019 at 02:58:41PM +0530, hariprasad@osuosl.org wrote:
> From: Hariprasad Kelam <hariprasad.kelam@gmail.com>
> 
> fix below issue reported by coccicheck
> drivers/staging//exfat/exfat_super.c:2709:26-33: WARNING opportunity for
> kmemdup
> 
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
> ---
>  drivers/staging/exfat/exfat_super.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

This doesn't apply to my tree at all, what did you make it against?

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-08  9:28 [PATCH] staging: exfat: make use of kmemdup hariprasad, Kelam, hariprasad.kelam
2019-09-08 13:05 ` Greg Kroah-Hartman

DriverDev-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/driverdev-devel/0 driverdev-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 driverdev-devel driverdev-devel/ https://lore.kernel.org/driverdev-devel \
		driverdev-devel@linuxdriverproject.org devel@driverdev.osuosl.org driverdev-devel@archiver.kernel.org
	public-inbox-index driverdev-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxdriverproject.driverdev-devel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox