You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/09/08 13:42:44 UTC

(nuttx) branch master updated: drivers/bch: fix uint32 overflow issue

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

xiaoxiang 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 5f0230d79f drivers/bch: fix uint32 overflow issue
5f0230d79f is described below

commit 5f0230d79f864c546ab1badba1d104ccc23114e8
Author: dongjiuzhu1 <do...@xiaomi.com>
AuthorDate: Thu Mar 21 16:52:59 2024 +0800

    drivers/bch: fix uint32 overflow issue
    
    Signed-off-by: dongjiuzhu1 <do...@xiaomi.com>
---
 drivers/bch/bchdev_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bch/bchdev_driver.c b/drivers/bch/bchdev_driver.c
index d9ff43833c..f0c61a8137 100644
--- a/drivers/bch/bchdev_driver.c
+++ b/drivers/bch/bchdev_driver.c
@@ -245,7 +245,7 @@ static off_t bch_seek(FAR struct file *filep, off_t offset, int whence)
       break;
 
     case SEEK_END:
-      newpos = bch->sectsize * bch->nsectors + offset;
+      newpos = (off_t)bch->sectsize * bch->nsectors + offset;
       break;
 
     default: