diff options
author | Luo Ji <ji.luo@nxp.com> | 2018-06-13 15:33:21 +0800 |
---|---|---|
committer | Ji Luo <ji.luo@nxp.com> | 2018-08-20 21:25:48 +0800 |
commit | 4cfd7437ac44f7bf64650e1f95628624d7eb79b2 (patch) | |
tree | b61b03d33c1e9bb08c77352ab8ab9199a8fa15ee | |
parent | 484e0dca8bc61909458f8a3511c66bdccb19a24e (diff) |
MA-11958 Fix userdata partition size overflow
The userdata partition size for some platforms
(like imx8/imx8m) could be larger than 4GB, use
"unsigned long int" to store the partition size
instead of "unsigned int".
Test: Get correct userdata partition size for imx8m.
Change-Id: Ib626fa2c3c64dde4eba3a93ee0455f45d1286c9f
Signed-off-by: Luo Ji <ji.luo@nxp.com>
-rw-r--r-- | drivers/usb/gadget/f_fastboot.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index 78a267877d..e82fd3b47c 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -2920,7 +2920,9 @@ static int get_single_var(char *cmd, char *response) strncat(response, "Wrong partition name.", chars_left); return -1; } else { - snprintf(response + strlen(response), chars_left, "0x%lx", (unsigned long int)fb_part->length * get_block_size()); + snprintf(response + strlen(response), chars_left, + "0x%lx", + (ulong)fb_part->length * get_block_size()); } } else if ((str = strstr(cmd, "partition-type:"))) { str +=strlen("partition-type:"); |