]> git.baikalelectronics.ru Git - kernel.git/commit
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>
Fri, 13 May 2022 08:03:40 +0000 (17:03 +0900)
commit68c70440bca69a0eb7d5ebdf95c22ad118e7dc1c
tree97e203094432ffb0279f427b9c61fc7311582c69
parent99735e851a4e4a700725c58e6bdf509a0ef401bd
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