diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-26 13:24:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-26 13:24:51 -0400 |
commit | 299650cad6bf00a0d119592f5e1d265bee938044 (patch) | |
tree | cd76a4d1c0cd63e6a976ca206dc076c30a06d77d /fs | |
parent | f76ddd98075de950cbb13f47b8356262d9f44c6d (diff) | |
parent | bf34be058158fd30622601346819d098dc5d623f (diff) |
Merge tag 'driver-core-3.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core fixes from Greg Kroah-Hartman:
"Here are a number of firmware core fixes for 3.7, and some other minor
fixes. And some documentation updates thrown in for good measure.
All have been in the linux-next tree for a while.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
* tag 'driver-core-3.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
Documentation:Chinese translation of Documentation/arm64/memory.txt
Documentation:Chinese translation of Documentation/arm64/booting.txt
Documentation:Chinese translation of Documentation/IRQ.txt
firmware loader: document kernel direct loading
sysfs: sysfs_pathname/sysfs_add_one: Use strlcat() instead of strcat()
dynamic_debug: Remove unnecessary __used
firmware loader: sync firmware cache by async_synchronize_full_domain
firmware loader: let direct loading back on 'firmware_buf'
firmware loader: fix one reqeust_firmware race
firmware loader: cancel uncache work before caching firmware
Diffstat (limited to 'fs')
-rw-r--r-- | fs/sysfs/dir.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c index 6b0bb00d4d2b..2fbdff6be25c 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c | |||
@@ -485,20 +485,18 @@ int __sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd) | |||
485 | /** | 485 | /** |
486 | * sysfs_pathname - return full path to sysfs dirent | 486 | * sysfs_pathname - return full path to sysfs dirent |
487 | * @sd: sysfs_dirent whose path we want | 487 | * @sd: sysfs_dirent whose path we want |
488 | * @path: caller allocated buffer | 488 | * @path: caller allocated buffer of size PATH_MAX |
489 | * | 489 | * |
490 | * Gives the name "/" to the sysfs_root entry; any path returned | 490 | * Gives the name "/" to the sysfs_root entry; any path returned |
491 | * is relative to wherever sysfs is mounted. | 491 | * is relative to wherever sysfs is mounted. |
492 | * | ||
493 | * XXX: does no error checking on @path size | ||
494 | */ | 492 | */ |
495 | static char *sysfs_pathname(struct sysfs_dirent *sd, char *path) | 493 | static char *sysfs_pathname(struct sysfs_dirent *sd, char *path) |
496 | { | 494 | { |
497 | if (sd->s_parent) { | 495 | if (sd->s_parent) { |
498 | sysfs_pathname(sd->s_parent, path); | 496 | sysfs_pathname(sd->s_parent, path); |
499 | strcat(path, "/"); | 497 | strlcat(path, "/", PATH_MAX); |
500 | } | 498 | } |
501 | strcat(path, sd->s_name); | 499 | strlcat(path, sd->s_name, PATH_MAX); |
502 | return path; | 500 | return path; |
503 | } | 501 | } |
504 | 502 | ||
@@ -531,9 +529,11 @@ int sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd) | |||
531 | char *path = kzalloc(PATH_MAX, GFP_KERNEL); | 529 | char *path = kzalloc(PATH_MAX, GFP_KERNEL); |
532 | WARN(1, KERN_WARNING | 530 | WARN(1, KERN_WARNING |
533 | "sysfs: cannot create duplicate filename '%s'\n", | 531 | "sysfs: cannot create duplicate filename '%s'\n", |
534 | (path == NULL) ? sd->s_name : | 532 | (path == NULL) ? sd->s_name |
535 | strcat(strcat(sysfs_pathname(acxt->parent_sd, path), "/"), | 533 | : (sysfs_pathname(acxt->parent_sd, path), |
536 | sd->s_name)); | 534 | strlcat(path, "/", PATH_MAX), |
535 | strlcat(path, sd->s_name, PATH_MAX), | ||
536 | path)); | ||
537 | kfree(path); | 537 | kfree(path); |
538 | } | 538 | } |
539 | 539 | ||