extcon: usbc-cros-ec: Use struct_size() helper in kzalloc()
authorGustavo A. R. Silva <gustavoars@kernel.org>
Tue, 25 Jan 2022 19:26:34 +0000 (13:26 -0600)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 16 Feb 2022 02:08:03 +0000 (11:08 +0900)
commit0f8f81c33cfb808883b6ede134d293403e55f4ee
treec60c658d9deec78597c55605b1798a82dcb9efd2
parentc74078fcc8869f5240e586e6a67fab8394ffd08c
extcon: usbc-cros-ec: Use struct_size() helper in kzalloc()

Make use of the struct_size() helper instead of an open-coded version,
in order to avoid any potential type mistakes or integer overflows that,
in the worst scenario, could lead to heap overflows.

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/extcon/extcon-usbc-cros-ec.c