Skip to content
Commit b7af938f authored by Dan Carpenter's avatar Dan Carpenter Committed by Wolfram Sang
Browse files

i2c: mux: harden i2c_mux_alloc() against integer overflows

A couple years back we went through the kernel an automatically
converted size calculations to use struct_size() instead.  The
struct_size() calculation is protected against integer overflows.

However it does not make sense to use the result from struct_size()
for additional math operations as that would negate any safeness.

Fixes: 1f3b69b6

 ("i2c: mux: Use struct_size() in devm_kzalloc()")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarPeter Rosin <peda@axentia.se>
Reviewed-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 37f071ec
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment