debug.c (ead5d1f4d877e92c051e1a1ade623d0d30e71619) | debug.c (be076fdf8369f3b4842362c64cd681f3d498f3dd) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * Copyright (c) International Business Machines Corp., 2006 4 * 5 * Author: Artem Bityutskiy (Битюцкий Артём) 6 */ 7 8#include "ubi.h" --- 497 unchanged lines hidden (view full) --- 506 struct ubi_debug_info *d = &ubi->dbg; 507 int n; 508 509 if (!IS_ENABLED(CONFIG_DEBUG_FS)) 510 return 0; 511 512 n = snprintf(d->dfs_dir_name, UBI_DFS_DIR_LEN + 1, UBI_DFS_DIR_NAME, 513 ubi->ubi_num); | 1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * Copyright (c) International Business Machines Corp., 2006 4 * 5 * Author: Artem Bityutskiy (Битюцкий Артём) 6 */ 7 8#include "ubi.h" --- 497 unchanged lines hidden (view full) --- 506 struct ubi_debug_info *d = &ubi->dbg; 507 int n; 508 509 if (!IS_ENABLED(CONFIG_DEBUG_FS)) 510 return 0; 511 512 n = snprintf(d->dfs_dir_name, UBI_DFS_DIR_LEN + 1, UBI_DFS_DIR_NAME, 513 ubi->ubi_num); |
514 if (n == UBI_DFS_DIR_LEN) { | 514 if (n > UBI_DFS_DIR_LEN) { |
515 /* The array size is too small */ 516 return -EINVAL; 517 } 518 519 d->dfs_dir = debugfs_create_dir(d->dfs_dir_name, dfs_rootdir); 520 521 d->dfs_chk_gen = debugfs_create_file("chk_gen", S_IWUSR, d->dfs_dir, 522 (void *)ubi_num, &dfs_fops); --- 83 unchanged lines hidden --- | 515 /* The array size is too small */ 516 return -EINVAL; 517 } 518 519 d->dfs_dir = debugfs_create_dir(d->dfs_dir_name, dfs_rootdir); 520 521 d->dfs_chk_gen = debugfs_create_file("chk_gen", S_IWUSR, d->dfs_dir, 522 (void *)ubi_num, &dfs_fops); --- 83 unchanged lines hidden --- |