mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
Fix misuses of bdevname()
bdevname() fills the buffer that it is given as a parameter, so calling strcpy() or snprintf() on the returned value is redundant (and probably not guaranteed to work - I don't think strcpy and snprintf support overlapping buffers.) Signed-off-by: Jean Delvare <[email protected]> Cc: Stephen Tweedie <[email protected]> Cc: Jens Axboe <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
78bb6cb9a8
commit
f36f21ecca
4 changed files with 6 additions and 8 deletions
|
|
@ -901,7 +901,7 @@ static void jbd2_stats_proc_init(journal_t *journal)
|
|||
{
|
||||
char name[BDEVNAME_SIZE];
|
||||
|
||||
snprintf(name, sizeof(name) - 1, "%s", bdevname(journal->j_dev, name));
|
||||
bdevname(journal->j_dev, name);
|
||||
journal->j_proc_entry = proc_mkdir(name, proc_jbd2_stats);
|
||||
if (journal->j_proc_entry) {
|
||||
proc_create_data("history", S_IRUGO, journal->j_proc_entry,
|
||||
|
|
@ -915,7 +915,7 @@ static void jbd2_stats_proc_exit(journal_t *journal)
|
|||
{
|
||||
char name[BDEVNAME_SIZE];
|
||||
|
||||
snprintf(name, sizeof(name) - 1, "%s", bdevname(journal->j_dev, name));
|
||||
bdevname(journal->j_dev, name);
|
||||
remove_proc_entry("info", journal->j_proc_entry);
|
||||
remove_proc_entry("history", journal->j_proc_entry);
|
||||
remove_proc_entry(name, proc_jbd2_stats);
|
||||
|
|
|
|||
Loading…
Reference in a new issue