net/ena/base: convert values to 32-bit before shifting
authorMichal Krawczyk <mk@semihalf.com>
Thu, 17 Sep 2020 05:30:31 +0000 (07:30 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 30 Sep 2020 17:19:09 +0000 (19:19 +0200)
commit3c7e44c7d3d460a642b5e907ef2f674a0c121a65
tree884a163df49dede6d920ea409576310cf0cf0f0a
parent4ad61424aaab783002947e4348afcd16ecb58327
net/ena/base: convert values to 32-bit before shifting

When filling out meta descriptor, all values should be converted to the
desired type (u32 in case of the meta descriptor) to prevent losing the
data.

For example, io_sq->phase is of type u8. If
ENA_ETH_IO_TX_META_DESC_PHASE_SHIFT would be greater then 8, all data
would be lost.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
drivers/net/ena/base/ena_eth_com.c