mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
fs: fix name overwrite in __register_chrdev_region()
It's possible to register a chrdev with a name size exactly the same as was allocated in structure. It seems it was not intended behaviour. At least chrdev_show does not like it. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
ba84be2338
commit
8c4018884a
1 changed files with 1 additions and 1 deletions
|
@ -120,7 +120,7 @@ __register_chrdev_region(unsigned int major, unsigned int baseminor,
|
|||
cd->major = major;
|
||||
cd->baseminor = baseminor;
|
||||
cd->minorct = minorct;
|
||||
strncpy(cd->name,name, 64);
|
||||
strlcpy(cd->name, name, sizeof(cd->name));
|
||||
|
||||
i = major_to_index(major);
|
||||
|
||||
|
|
Loading…
Reference in a new issue