Skip to content

Commit 3e8c3d4

Browse files
committed
ethtool: cmis: fix u16-to-u8 truncation of msleep_pre_rpl
ethtool_cmis_cdb_compose_args() accepts msleep_pre_rpl as u16 but stores it into the u8 field ethtool_cmis_cdb_cmd_args::msleep_pre_rpl, silently truncating values >= 256. Seven of the nine call sites pass 1000 ms (it's the third argument from the end). Fixes: a39c84d ("ethtool: cmis_cdb: Add a layer for supporting CDB commands") Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Reviewed-by: Danielle Ratson <danieller@nvidia.com> Link: https://patch.msgid.link/20260522231312.1710836-8-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 6c3f999 commit 3e8c3d4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

net/ethtool/cmis.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,18 @@ struct ethtool_cmis_cdb_request {
6363
* struct ethtool_cmis_cdb_cmd_args - CDB commands execution arguments
6464
* @req: CDB command fields as described in the CMIS standard.
6565
* @max_duration: Maximum duration time for command completion in msec.
66+
* @msleep_pre_rpl: Waiting time before checking reply in msec.
6667
* @read_write_len_ext: Allowable additional number of byte octets to the LPL
6768
* in a READ or a WRITE commands.
68-
* @msleep_pre_rpl: Waiting time before checking reply in msec.
6969
* @rpl_exp_len: Expected reply length in bytes.
7070
* @flags: Validation flags for CDB commands.
7171
* @err_msg: Error message to be sent to user space.
7272
*/
7373
struct ethtool_cmis_cdb_cmd_args {
7474
struct ethtool_cmis_cdb_request req;
7575
u16 max_duration;
76+
u16 msleep_pre_rpl;
7677
u8 read_write_len_ext;
77-
u8 msleep_pre_rpl;
7878
u8 rpl_exp_len;
7979
u8 flags;
8080
char *err_msg;

0 commit comments

Comments
 (0)