This is an automated email from the ASF dual-hosted git repository.

Donny9 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 89bb03ba432 fs/vfs: result_independent_of_operands
89bb03ba432 is described below

commit 89bb03ba4328a6f413ec3a4c06a0fa34c8af8bf0
Author: zhengyu9 <[email protected]>
AuthorDate: Sun Nov 29 12:23:54 2026 +0800

    fs/vfs: result_independent_of_operands
    
    timeout is a type of int
    in MSEC2TICK, timeout may be multiplied by USEC_PER_MSEC
    and the result may be out of range of int
    Besides, this will induce following ERROR while running simulator:
    vfs/fs_poll.c:498:38: runtime error: signed integer overflow:
    19768268 * 1000 cannot be represented in type 'int'
    
    Signed-off-by: zhengyu9 <[email protected]>
    Signed-off-by: ligd <[email protected]>
    
    Signed-off-by: jingfei <[email protected]>
---
 fs/vfs/fs_poll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/vfs/fs_poll.c b/fs/vfs/fs_poll.c
index eefe6c6d737..15d6d80129a 100644
--- a/fs/vfs/fs_poll.c
+++ b/fs/vfs/fs_poll.c
@@ -531,7 +531,7 @@ int nx_poll(FAR struct pollfd *fds, nfds_t nfds, int 
timeout,
            * will return immediately.
            */
 
-          ret = nxsem_tickwait(&sem, MSEC2TICK(timeout));
+          ret = nxsem_tickwait(&sem, MSEC2TICK((clock_t)timeout));
           if (ret < 0)
             {
               if (ret == -ETIMEDOUT)

Reply via email to