SC2070 (error): -n doesn't work with unquoted arguments.
Quote or use [[ ]].
In grub-completion.bash.in line 130:
[ -n $tmp ] && {
^--^ SC2070 (error)
More: https://github.com/koalaman/shellcheck/wiki/SC2070
Signed-off-by: "t.feng"
---
util/bash-completion.d/grub-
SC2155 (warning): Declare and assign separately to avoid masking return
values.
The exit status of the command is overridden by the exit status of the
creation of the local variable.
In grub-completion.bash.in line 115:
local config_file=$(__grub_dir)/grub.cfg
^-^ SC2155 (w
COMPREPLY=($(command)) are doing unquoted command expansion in an array.
This will invoke the shell's sloppy word splitting and glob expansion.
If we want to split the output into lines or words, use read -r and
loops will be better. This prevents the shell from doing unwanted
splitting and glob
SC2120 (warning): function references arguments, but none are ever
passed.
In grub-completion.bash.in line 63:
__grub_get_options_from_help () {
^-- SC2120 (warning)
local prog
if [ $# -ge 1 ]; then
prog="$1"
The arg of __grub_get_options_from_help is optional, so the current
Hi,
The patch set fix some warning and error in grub-completion.bash.in.
And shellcheck also provides 'info' and 'style' level check, i think
grub do not need to modify.
shellcheck -s bash -S warning grub-completion.bash.in
shellcheck:https://github.com/koalaman/shellcheck
V3:
change functions
In grub-completion.bash.in line 63:
__grub_get_options_from_help () {
^-- SC2120 (warning)
SC2120: the current code meets the exception and does not need to be
modified. So we disable it.
ref:https://github.com/koalaman/shellcheck/wiki/SC2120
Signed-off-by: "t.feng"
---
util/bash-completion.d/
Hi,
The patch set fix some warning and error in grub-completion.bash.in.
And shellcheck also provides 'info' and 'style' level check, i think
grub do not need to modify.
shellcheck -s bash -S warning grub-completion.bash.in
shellcheck:https://github.com/koalaman/shellcheck
V2:
split warnings p
SC2207 (warning): Prefer mapfile or read -a to split
command output (or quote to avoid splitting).
In grub-completion.bash.in line 56:
COMPREPLY=($(compgen -P "${2-}" -W "${1-}" -S "${4-}" --
"$cur"))
^-- SC2207 (warning)
In grub-completion.bash.in line 119:
COM
In grub-completion.bash.in line 115:
local config_file=$(__grub_dir)/grub.cfg
^-^ SC2155 (warning)
In grub-completion.bash.in line 126:
local grub_dir=$(__grub_dir)
^--^ SC2155 (warning)
ref:https://github.com/koalaman/shellcheck/wiki/SC2155
Signed-off-by:
SC2070 (error): -n doesn't work with unquoted arguments.
Quote or use [[ ]].
In grub-completion.bash.in line 130:
[ -n $tmp ] && {
^--^ SC2070 (error)
ref:https://github.com/koalaman/shellcheck/wiki/SC2070
Signed-off-by: "t.feng"
---
util/bash-completion.d/grub-co
Hi all,
I am doing code review in grub-core/fs module and I found some
memory leaks.
V2:
use goto statement in fs/minix and fs/ntfs.
**
t.feng (9):
fs/affs:Fix memory leaks in grub_affs_create_node
fs/btrfs: Fix memory leak in find_path
fs/minix: Fix memory leak i
Fix memory leak in grub_hfsplus_btree_search.
Fixes: 58ea11d5b(Don't fetch a key beyond the end of the node)
Signed-off-by: "t.feng"
Reviewed-by: Daniel Kiper
---
grub-core/fs/hfsplus.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/grub-core/fs/hfsplus.c b/grub-core/f
Fix memory leaks in read_bfs_file.
l1_entries and l2_entries are forgotten to be freed if
end of reading file.
Fixes: 5825b3794(BFS implementation based on the specification.)
Signed-off-by: "t.feng"
Reviewed-by: Daniel Kiper
---
grub-core/fs/bfs.c | 2 ++
1 file changed, 2 insertions(+)
diff
Fix memory leak in find_path.
Fixs: 82591fa6e(Make / in btrfe refer to real root)
Signed-off-by: "t.feng"
Reviewed-by: Daniel Kiper
---
grub-core/fs/btrfs.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
index ec72f7be3..19
Fix memory leaks in grub_minix_lookup_symlink.
Fixes: a07e6ad01(Remove variable length arrays)
Signed-off-by: "t.feng"
---
grub-core/fs/minix.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/grub-core/fs/minix.c b/grub-core/fs/minix.c
index 953df1191..5354951d1 100644
hashtable is unfreed in case GRUB_AFFS_FILETYPE_HARDLINK if
grub_disk_read failed. Because, if grub_affs_create_node
return not zero, the hashtable should be freed.
By the way hashtable is unused in grub_affs_create_node, so we can
remove the parameter and take care of it in grub_affs_iterate_dir.
Fix memory leak in grub_iso9660_susp_iterate.
Fixes: 99373ce47(iso9660.c: Remove nested functions.)
Signed-off-by: "t.feng"
Reviewed-by: Thomas Schmitt
Reviewed-by: Daniel Kiper
---
grub-core/fs/iso9660.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/grub-core
Fix memory leaks in grub_ntfs_read_symlink.
Fixes: 5773fb641(Support NTFS reparse points.)
Signed-off-by: "t.feng"
---
grub-core/fs/ntfs.c | 26 +++---
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/grub-core/fs/ntfs.c b/grub-core/fs/ntfs.c
index 3511e4e2c..
Fix memory leaks in grub_squash_iterate_dir.
Fixes: 20dd511c8(Handle "." and ".." on squashfs.)
Signed-off-by: "t.feng"
Reviewed-by: Daniel Kiper
---
grub-core/fs/squash4.c | 20
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/grub-core/fs/squash4.c b/grub-c
Fix memory leaks in xfs.
Signed-off-by: "t.feng"
Reviewed-by: Daniel Kiper
---
grub-core/fs/xfs.c | 11 +--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c
index d6de7f1a2..b67407690 100644
--- a/grub-core/fs/xfs.c
+++ b/grub-core/fs
Fix memory leak in find_path.
Fixs: 82591fa6e(Make / in btrfe refer to real root)
Signed-off-by: "t.feng"
---
grub-core/fs/btrfs.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
index ec72f7be3..19bff4610 100644
--- a/grub-c
Fix memory leak in grub_hfsplus_btree_search.
Fixes: 58ea11d5b(Don't fetch a key beyond the end of the node)
Signed-off-by: "t.feng"
---
grub-core/fs/hfsplus.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/grub-core/fs/hfsplus.c b/grub-core/fs/hfsplus.c
index 6337cbfcb
Fix memory leaks in grub_minix_lookup_symlink.
Fixes: a07e6ad01(Remove variable length arrays)
Signed-off-by: "t.feng"
---
grub-core/fs/minix.c | 11 +--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/grub-core/fs/minix.c b/grub-core/fs/minix.c
index 953df1191..2176b6e93
hashtable is unfreed in case GRUB_AFFS_FILETYPE_HARDLINK if
grub_disk_read failed. Because, if grub_affs_create_node
return not zero, the hashtable should be freed.
By the way hashtable is unused in grub_affs_create_node, so we can
remove the parameter and take care of it in grub_affs_iterate_dir.
Fix memory leaks in read_bfs_file.
l1_entries and l2_entries are forgotten to be freed if
end of reading file.
Fixes: 5825b3794(BFS implementation based on the specification.)
Signed-off-by: "t.feng"
---
grub-core/fs/bfs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/grub-core/fs/bfs.c
Fix memory leak in grub_iso9660_susp_iterate.
Fixes: 99373ce47(iso9660.c: Remove nested functions.)
Signed-off-by: "t.feng"
---
grub-core/fs/iso9660.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/grub-core/fs/iso9660.c b/grub-core/fs/iso9660.c
index 91817ec1f..
Fix memory leaks in xfs.
Signed-off-by: "t.feng"
---
grub-core/fs/xfs.c | 11 +--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c
index d6de7f1a2..b67407690 100644
--- a/grub-core/fs/xfs.c
+++ b/grub-core/fs/xfs.c
@@ -585,7 +585,10 @@
Hi all,
I am doing code review in grub-core/fs module and I found some
memory leaks.
*
t.feng (9):
fs/affs:Fix memory leaks in grub_affs_create_node
fs/btrfs: Fix memory leak in find_path
fs/minix: Fix memory leak in grub_minix_lookup_symlink
fs/ntfs: Fix memory le
Fix memory leaks in grub_ntfs_read_symlink.
Fixes: 5773fb641(Support NTFS reparse points.)
Signed-off-by: "t.feng"
---
grub-core/fs/ntfs.c | 26 ++
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/grub-core/fs/ntfs.c b/grub-core/fs/ntfs.c
index 3511e4e2c..e
Fix memory leaks in grub_squash_iterate_dir.
Fixes: 20dd511c8(Handle "." and ".." on squashfs.)
Signed-off-by: "t.feng"
---
grub-core/fs/squash4.c | 20
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/grub-core/fs/squash4.c b/grub-core/fs/squash4.c
index 02b1
The commit eb33e61b3 (multiboot: fix memory leak) did not fix all
issues. Fix all of them right now.
Fixes: eb33e61b3 (multiboot: fix memory leak)
Signed-off-by: "t.feng"
---
grub-core/loader/multiboot_elfxx.c | 23 ++-
1 file changed, 14 insertions(+), 9 deletions(-)
diff
The commit eb33e61b3 (multiboot: fix memory leak) did not fix all
issues. Fix all of them right now.
Fixes: eb33e61b3 (multiboot: fix memory leak)
---
grub-core/loader/multiboot_elfxx.c | 23 ++-
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/grub-core/loader/
follow up the commit:
eb33e61b31902a5493468895aaf83fa0b4f5f59d
it seems that old commit can not fix memory leak completely.
---
grub-core/loader/multiboot_elfxx.c | 17 +
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/grub-core/loader/multiboot_elfxx.c
b/grub-core
SC2207 (warning): Prefer mapfile or read -a to split
command output (or quote to avoid splitting).
SC2120 (warning): __grub_get_options_from_help references arguments,
but none are ever passed.
SC2155 (warning): Declare and assign separately to avoid
masking return values.
In grub-completion.bash.
SC2070 (error): -n doesn't work with unquoted arguments.
Quote or use [[ ]].
In grub-completion.bash.in line 130:
[ -n $tmp ] && {
^--^ SC2070 (error)
ref:https://github.com/koalaman/shellcheck/wiki/SC2070
---
util/bash-completion.d/grub-completion.bash.in | 2 +-
Hi,
The patch set fix some warning and error in grub-completion.bash.in.
And shellcheck also provides 'info' and 'style' level check, i think grub
do not need to modify.
shellcheck -s bash -S warning grub-completion.bash.in
shellcheck:https://github.com/koalaman/shellcheck
t.feng (2):
bash-com
36 matches
Mail list logo