drivers/mtd/bch: fix size_t overflow when offset > 4GB
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
parent
9d5b9b7c05
commit
c978f2fe4c
|
@ -64,7 +64,7 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
ssize_t bchlib_read(FAR void *handle, FAR char *buffer, size_t offset,
|
ssize_t bchlib_read(FAR void *handle, FAR char *buffer, off_t offset,
|
||||||
size_t len)
|
size_t len)
|
||||||
{
|
{
|
||||||
FAR struct bchlib_s *bch = (FAR struct bchlib_s *)handle;
|
FAR struct bchlib_s *bch = (FAR struct bchlib_s *)handle;
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, size_t offset,
|
ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, off_t offset,
|
||||||
size_t len)
|
size_t len)
|
||||||
{
|
{
|
||||||
FAR struct bchlib_s *bch = (FAR struct bchlib_s *)handle;
|
FAR struct bchlib_s *bch = (FAR struct bchlib_s *)handle;
|
||||||
|
|
|
@ -725,7 +725,7 @@ static int mtd_loop_ioctl(FAR struct file *filep, int cmd,
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
FAR struct mtd_dev_s *filemtd_initialize(FAR const char *path, size_t offset,
|
FAR struct mtd_dev_s *filemtd_initialize(FAR const char *path, off_t offset,
|
||||||
int16_t sectsize, int32_t erasesize)
|
int16_t sectsize, int32_t erasesize)
|
||||||
{
|
{
|
||||||
FAR struct file_dev_s *priv;
|
FAR struct file_dev_s *priv;
|
||||||
|
|
|
@ -231,7 +231,7 @@ int bchlib_teardown(FAR void *handle);
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
ssize_t bchlib_read(FAR void *handle, FAR char *buffer, size_t offset,
|
ssize_t bchlib_read(FAR void *handle, FAR char *buffer, off_t offset,
|
||||||
size_t len);
|
size_t len);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -243,7 +243,7 @@ ssize_t bchlib_read(FAR void *handle, FAR char *buffer, size_t offset,
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, size_t offset,
|
ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, off_t offset,
|
||||||
size_t len);
|
size_t len);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|
|
@ -657,7 +657,7 @@ FAR struct mtd_dev_s *w25qxxxjv_initialize(FAR struct qspi_dev_s *qspi,
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
FAR struct mtd_dev_s *filemtd_initialize(FAR const char *path, size_t offset,
|
FAR struct mtd_dev_s *filemtd_initialize(FAR const char *path, off_t offset,
|
||||||
int16_t sectsize,
|
int16_t sectsize,
|
||||||
int32_t erasesize);
|
int32_t erasesize);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue