提交 b92b47fc 编写于 作者: A Andy Shevchenko 提交者: Xie XiuQi

net: dev: Use unsigned integer as an argument to left-shift

mainline inclusion
from mainline-5.0
commit f4d7b3e23d259c44f1f1c39645450680fcd935d6
category: bugfix
bugzilla: 11090
CVE: NA

-------------------------------------------------
1 << 31 is Undefined Behaviour according to the C standard.
Use U type modifier to avoid theoretical overflow.
Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
(cherry picked from commit f4d7b3e23d259c44f1f1c39645450680fcd935d6)
Signed-off-by: NZhen Lei <thunder.leizhen@huawei.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 91264b1b
......@@ -3787,7 +3787,7 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits)
if (debug_value == 0) /* no output */
return 0;
/* set low N bits */
return (1 << debug_value) - 1;
return (1U << debug_value) - 1;
}
static inline void __netif_tx_lock(struct netdev_queue *txq, int cpu)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册