cmd: fix clone coverity scan
PATCH 1/1 cmd: fix clone coverity scan
From: John Chau <[email protected]>
This patch fixes coverity scan MISSING_BREAK issues, and also an error on block size check.
Signed-off-by John Chau <[email protected]>
---
cmd/clone.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
cmd/clone.c +5 -3
@@ -37,7 +37,7 @@ static int do_clone(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) srcbz = srcdesc->blksz; destbz = destdesc->blksz; -if ((srcbz * (buffersize / srcbz) != buffersize) && +if ((srcbz * (buffersize / srcbz) != buffersize) || (destbz * (buffersize / destbz) != buffersize)) {printf ("failed: cannot match device block sizes\n" );return 1 ;
@@ -54,10 +54,12 @@ static int do_clone(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])switch (unit[0 ]) {case 'g' :case 'G' : - requested *=1024 ; + requested *=1024 *1024 *1024 ; +break ;case 'm' :case 'M' : - requested *=1024 ; + requested *=1024 *1024 ; +break ;case 'k' :case 'K' : requested *=1024 ;
Signature · 1 line
2.25.1
PATCH 1/1 cmd: fix clone coverity scan
Quoted 6 lines · John Chau
From: John Chau <[email protected]>
This patch fixes coverity scan
MISSING_BREAKissues, and also an error on block size check.Signed-off-by John Chau <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200825/b8af883c/attachment.sig>