Skip to content

lib: os: Fix ZVFS leaking without being enabled#101415

Merged
MaureenHelm merged 1 commit intozephyrproject-rtos:mainfrom
nordicjm:fixzvfsleak
Jan 9, 2026
Merged

lib: os: Fix ZVFS leaking without being enabled#101415
MaureenHelm merged 1 commit intozephyrproject-rtos:mainfrom
nordicjm:fixzvfsleak

Conversation

@nordicjm
Copy link
Copy Markdown
Contributor

Fixes this define leaking into all application source files when the feature is not even enabled

Fixes #101414

@nordicjm nordicjm requested a review from jukkar December 22, 2025 09:58
@nordicjm nordicjm added the backport v4.3-branch Request backport to the v4.3-branch label Dec 22, 2025
@zephyrbot zephyrbot added the area: Base OS Base OS Library (lib/os) label Dec 22, 2025
@jukkar jukkar requested a review from cfriedt December 27, 2025 18:54
@cfriedt
Copy link
Copy Markdown
Member

cfriedt commented Jan 2, 2026

@nordicjm - LGTM other than one small change needed to avoid compile errors.

diff --git a/include/zephyr/sys/fdtable.h b/include/zephyr/sys/fdtable.h
index 50896db79a3..4903a5ae341 100644
--- a/include/zephyr/sys/fdtable.h
+++ b/include/zephyr/sys/fdtable.h
@@ -257,7 +257,11 @@ struct zvfs_pollfd {
 __syscall int zvfs_poll(struct zvfs_pollfd *fds, int nfds, int poll_timeout);
 
 struct zvfs_fd_set {
+#ifdef ZVFS_OPEN_SIZE
        uint32_t bitset[DIV_ROUND_UP(ZVFS_OPEN_SIZE, 32)];
+#else
+       uint32_t bitset[1];
+#endif
 };
 
 /** @brief Number of file descriptors which can be added @ref zvfs_fd_set */

peter-mitsis
peter-mitsis previously approved these changes Jan 7, 2026
@nordicjm
Copy link
Copy Markdown
Contributor Author

nordicjm commented Jan 9, 2026

+       uint32_t bitset[1];

Thanks, added

Fixes this define leaking into all application source files when
the feature is not even enabled

Co-authored-by: Chris Friedt <cfriedt@tenstorrent.com>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jan 9, 2026

@MaureenHelm MaureenHelm merged commit d94ed7b into zephyrproject-rtos:main Jan 9, 2026
26 checks passed
@nordicjm nordicjm deleted the fixzvfsleak branch January 20, 2026 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Base OS Base OS Library (lib/os) backport v4.3-branch Request backport to the v4.3-branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ZVFS_OPEN_SIZE define applied irrespective of configuration

7 participants