Wu Bo
unread,Jun 4, 2020, 8:10:49 AM6/4/20Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ldu...@suse.com, open-...@googlegroups.com, liuzhi...@huawei.com, linfe...@huawei.com, liub...@huawei.com
From: liubo <
liub...@huawei.com>
Fix the potential risk of rc value being washed out by jumping out of the loop
Signed-off-by: liubo <
liub...@huawei.com>
Reported-by: Zhiqiang Liu <
liuzhi...@huawei.com>
---
utils/fwparam_ibft/fwparam_sysfs.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/utils/fwparam_ibft/fwparam_sysfs.c b/utils/fwparam_ibft/fwparam_sysfs.c
index a0cd1c7..87fd6d4 100644
--- a/utils/fwparam_ibft/fwparam_sysfs.c
+++ b/utils/fwparam_ibft/fwparam_sysfs.c
@@ -115,8 +115,11 @@ static int get_iface_from_device(char *id, struct boot_context *context)
break;
}
- if (sscanf(dent->d_name, "net:%s", context->iface) != 1)
+ if (sscanf(dent->d_name, "net:%s", context->iface) != 1) {
rc = EINVAL;
+ break;
+ }
+
rc = 0;
break;
} else {
--
2.21.0.windows.1