usb: storage: Fix overwritten in usb_stor_set_max_xfer_blk()
PATCH 1/1 usb: storage: Fix overwritten in usb_stor_set_max_xfer_blk()
The stored 'blk' value is overwritten to 'size / 512' before it can be used in usb_stor_set_max_xfer_blk(). This is not what we want. In fact, when 'size' exceeds the upper limit (USHRT_MAX * 512), we should simply assign 'size' to the upper limit.
---
common/usb_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/usb_storage.c +1 -1
@@ -964,7 +964,7 @@ static void usb_stor_set_max_xfer_blk(struct usb_device *udev, blk = 20; }else {if (size >USHRT_MAX *512 ) - blk =USHRT_MAX ; + size =USHRT_MAX *512 ; blk = size /512 ; }#endif
Signature · 1 line
2.7.4
PATCH 1/1 usb: storage: Fix overwritten in usb_stor_set_max_xfer_blk()
Quoted 7 lines · Bin Meng
The stored 'blk' value is overwritten to 'size / 512' before it can be used in
usb_stor_set_max_xfer_blk(). This is not what we want. In fact, when 'size' exceeds the upper limit (USHRT_MAX* 512), we should simply assign 'size' to the upper limit.Reported-by Coverity (CID: 167250)Signed-off-by Bin Meng <[email protected]>
Still failing
https://travis-ci.org/marex/u-boot-usb/builds/280835848
Quoted 19 lines
---
common/usb_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)common/usb_storage.c +1
-1@@ -964,7 +964,7 @@ static void usb_stor_set_max_xfer_blk(struct usb_device *udev, blk = 20; }else {if (size >USHRT_MAX *512 ) - blk =USHRT_MAX ; + size =USHRT_MAX *512 ; blk = size /512 ; }#endif
Signature · 2 lines
Best regards, Marek Vasut
PATCH 1/1 usb: storage: Fix overwritten in usb_stor_set_max_xfer_blk()
Hi Marek,
Quoted 6 lines · Marek Vasut
Quoted 5 lines · Bin Meng
The stored 'blk' value is overwritten to 'size / 512' before it can be used in
usb_stor_set_max_xfer_blk(). This is not what we want. In fact, when 'size' exceeds the upper limit (USHRT_MAX* 512), we should simply assign 'size' to the upper limit.
Quoted 6 lines
Quoted 2 lines
Reported-by Coverity (CID: 167250)Signed-off-by Bin Meng <[email protected]>Still failing
https://travis-ci.org/marex/u-boot-usb/builds/280835848
This fixes the Coverity issue, not the 'make tests' issue. Please hold on apply the xHCI patchset and when the fix is ready I will send v2.
Quoted 5 lines
Quoted 5 lines
---
common/usb_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines
Quoted 6 lines
common/usb_storage.c +0
-0common/usb_storage.c static void usb_stor_set_max_xfer_blk(struct usb_device *udev, · line 970
Quoted 8 lines
common/usb_storage.c +1
-1@@ -964,7 +964,7 @@ static void usb_stor_set_max_xfer_blk(struct usb_device *udev, blk = 20; }else {if (size >USHRT_MAX *512 ) - blk =USHRT_MAX ; + size =USHRT_MAX *512 ; blk = size /512 ; }#endif
Regards,
Bin
PATCH 1/1 usb: storage: Fix overwritten in usb_stor_set_max_xfer_blk()
Quoted 12 lines · Bin Meng
Hi Marek,
Quoted 9 lines · Marek Vasut
Quoted 7 lines · Bin Meng
The stored 'blk' value is overwritten to 'size / 512' before it can be used in
usb_stor_set_max_xfer_blk(). This is not what we want. In fact, when 'size' exceeds the upper limit (USHRT_MAX* 512), we should simply assign 'size' to the upper limit.Reported-by Coverity (CID: 167250)Signed-off-by Bin Meng <[email protected]>
Quoted 6 lines
Quoted 3 lines
Still failing
https://travis-ci.org/marex/u-boot-usb/builds/280835848This fixes the Coverity issue, not the 'make tests' issue. Please hold on apply the xHCI patchset and when the fix is ready I will send v2.
Can't you send me fix on top of current set ? If not, OK, tell me what to drop and what to pick.
Thanks
Quoted 23 lines
Quoted 5 lines
Quoted 5 lines
---
common/usb_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 14 lines
Quoted 6 lines
common/usb_storage.c +0
-0common/usb_storage.c static void usb_stor_set_max_xfer_blk(struct usb_device *udev, · line 970
Quoted 8 lines
common/usb_storage.c +1
-1@@ -964,7 +964,7 @@ static void usb_stor_set_max_xfer_blk(struct usb_device *udev, blk = 20; }else {if (size >USHRT_MAX *512 ) - blk =USHRT_MAX ; + size =USHRT_MAX *512 ; blk = size /512 ; }#endif Regards,
Bin
Signature · 2 lines
Best regards, Marek Vasut
PATCH 1/1 usb: storage: Fix overwritten in usb_stor_set_max_xfer_blk()
Hi Marek,
Quoted 17 lines · Marek Vasut
Quoted 16 lines · Bin Meng
Hi Marek,
Quoted 12 lines · Marek Vasut
Quoted 7 lines · Bin Meng
The stored 'blk' value is overwritten to 'size / 512' before it can be used in
usb_stor_set_max_xfer_blk(). This is not what we want. In fact, when 'size' exceeds the upper limit (USHRT_MAX* 512), we should simply assign 'size' to the upper limit.Reported-by Coverity (CID: 167250)Signed-off-by Bin Meng <[email protected]>Still failing
https://travis-ci.org/marex/u-boot-usb/builds/280835848
Quoted 6 lines
Quoted 2 lines
This fixes the Coverity issue, not the 'make tests' issue. Please hold on apply the xHCI patchset and when the fix is ready I will send v2.
Can't you send me fix on top of current set ? If not, OK, tell me what to drop and what to pick.
OK, will do.
Regards,
Bin
PATCH 1/1 usb: storage: Fix overwritten in usb_stor_set_max_xfer_blk()
Quoted 20 lines · Bin Meng
Hi Marek,
Quoted 17 lines · Marek Vasut
Quoted 16 lines · Bin Meng
Hi Marek,
Quoted 12 lines · Marek Vasut
Quoted 7 lines · Bin Meng
The stored 'blk' value is overwritten to 'size / 512' before it can be used in
usb_stor_set_max_xfer_blk(). This is not what we want. In fact, when 'size' exceeds the upper limit (USHRT_MAX* 512), we should simply assign 'size' to the upper limit.Reported-by Coverity (CID: 167250)Signed-off-by Bin Meng <[email protected]>Still failing
https://travis-ci.org/marex/u-boot-usb/builds/280835848
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
This fixes the Coverity issue, not the 'make tests' issue. Please hold on apply the xHCI patchset and when the fix is ready I will send v2.
Can't you send me fix on top of current set ? If not, OK, tell me what to drop and what to pick.
OK, will do.
Thanks!
Signature · 2 lines
Best regards, Marek Vasut
PATCH 1/1 usb: storage: Fix overwritten in usb_stor_set_max_xfer_blk()
Hi Marek,
Quoted 24 lines · Marek Vasut
Quoted 23 lines · Bin Meng
Hi Marek,
Quoted 20 lines · Marek Vasut
Quoted 18 lines · Bin Meng
Hi Marek,
Quoted 6 lines · Marek Vasut
Quoted 5 lines · Bin Meng
The stored 'blk' value is overwritten to 'size / 512' before it can be used in
usb_stor_set_max_xfer_blk(). This is not what we want. In fact, when 'size' exceeds the upper limit (USHRT_MAX* 512), we should simply assign 'size' to the upper limit.Quoted 6 lines
Quoted 2 lines
Reported-by Coverity (CID: 167250)Signed-off-by Bin Meng <[email protected]>Still failing
https://travis-ci.org/marex/u-boot-usb/builds/280835848This fixes the Coverity issue, not the 'make tests' issue. Please hold on apply the xHCI patchset and when the fix is ready I will send v2.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Can't you send me fix on top of current set ? If not, OK, tell me what to drop and what to pick.
OK, will do.
Thanks!
I just sent additional patches
(http://patchwork.ozlabs.org/project/uboot/list/?series=5892) to fix the 'make tests' issues.
Please do the following on the u-boot-usb/master branch:
1). Drop http://git.denx.de/?p=u-boot/u-boot-usb.git;a=commit;h=198db64035a589ef19920b2cec58419b4b338ce7
2). Drop http://git.denx.de/?p=u-boot/u-boot-usb.git;a=commit;h=9a462a3af216d77fee689f119419506218531f77
3). Apply http://patchwork.ozlabs.org/project/uboot/list/?series=5892
on top of u-boot-usb/master
Then everything should be fine.
Regards,
Bin
PATCH 1/1 usb: storage: Fix overwritten in usb_stor_set_max_xfer_blk()
Quoted 40 lines · Bin Meng
Hi Marek,
Quoted 24 lines · Marek Vasut
Quoted 23 lines · Bin Meng
Hi Marek,
Quoted 20 lines · Marek Vasut
Quoted 18 lines · Bin Meng
Hi Marek,
Quoted 6 lines · Marek Vasut
Quoted 5 lines · Bin Meng
The stored 'blk' value is overwritten to 'size / 512' before it can be used in
usb_stor_set_max_xfer_blk(). This is not what we want. In fact, when 'size' exceeds the upper limit (USHRT_MAX* 512), we should simply assign 'size' to the upper limit.Quoted 6 lines
Quoted 2 lines
Reported-by Coverity (CID: 167250)Signed-off-by Bin Meng <[email protected]>Still failing
https://travis-ci.org/marex/u-boot-usb/builds/280835848This fixes the Coverity issue, not the 'make tests' issue. Please hold on apply the xHCI patchset and when the fix is ready I will send v2.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Can't you send me fix on top of current set ? If not, OK, tell me what to drop and what to pick.
OK, will do.
Thanks!
I just sent additional patches
(http://patchwork.ozlabs.org/project/uboot/list/?series=5892) to fix the 'make tests' issues.
Quoted 8 lines
Please do the following on the u-boot-usb/master branch:
1). Drop http://git.denx.de/?p=u-boot/u-boot-usb.git;a=commit;h=198db64035a589ef19920b2cec58419b4b338ce7
2). Drop http://git.denx.de/?p=u-boot/u-boot-usb.git;a=commit;h=9a462a3af216d77fee689f119419506218531f77
3). Apply http://patchwork.ozlabs.org/project/uboot/list/?series=5892
on top of u-boot-usb/masterThen everything should be fine.
Build tests pass, PR out, thanks !
Signature · 2 lines
Best regards, Marek Vasut