[-mm patch] inotify: fsnotify.h: use kstrdup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



kstrdup was added in 2.6.13-rc1.

Signed-off-by: Adrian Bunk <[email protected]>

--- linux-2.6.12-mm2-full/include/linux/fsnotify.h.old	2005-06-30 22:26:07.000000000 +0200
+++ linux-2.6.12-mm2-full/include/linux/fsnotify.h	2005-06-30 22:27:26.000000000 +0200
@@ -216,19 +216,10 @@
 
 /*
  * fsnotify_oldname_init - save off the old filename before we change it
- *
- * XXX: This could be kstrdup if only we could add that to lib/string.c
  */
 static inline const char *fsnotify_oldname_init(const char *name)
 {
-	size_t len;
-	char *buf;
-
-	len = strlen(name) + 1;
-	buf = kmalloc(len, GFP_KERNEL);
-	if (likely(buf))
-		memcpy(buf, name, len);
-	return buf;
+	return kstrdup(name, GFP_KERNEL);
 }
 
 /*

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux