mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git
synced 2025-09-13 11:07:46 +10:00
configfs: Do not override creating attribute file failure in populate_attrs()
commitf830edbae2
upstream. populate_attrs() may override failure for creating attribute files by success for creating subsequent bin attribute files, and have wrong return value. Fix by creating bin attribute files under successfully creating attribute files. Fixes:03607ace80
("configfs: implement binary attributes") Cc: stable@vger.kernel.org Reviewed-by: Joel Becker <jlbec@evilplan.org> Reviewed-by: Breno Leitao <leitao@debian.org> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com> Link: https://lore.kernel.org/r/20250507-fix_configfs-v3-2-fe2d96de8dc4@quicinc.com Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
4ad892bdac
commit
8cb51a55b2
@ -593,7 +593,7 @@ static int populate_attrs(struct config_item *item)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (t->ct_bin_attrs) {
|
||||
if (!error && t->ct_bin_attrs) {
|
||||
for (i = 0; (bin_attr = t->ct_bin_attrs[i]) != NULL; i++) {
|
||||
error = configfs_create_bin_file(item, bin_attr);
|
||||
if (error)
|
||||
|
Loading…
Reference in New Issue
Block a user