From: Thorsten Blum Date: Thu, 11 Jun 2026 21:55:02 +0000 (+0200) Subject: i2c: atr: annotate i2c_atr_adap_desc->aliases with __counted_by_ptr X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e696bc33c30acda698e5e921adcc7f7e61976f7;p=thirdparty%2Flinux.git i2c: atr: annotate i2c_atr_adap_desc->aliases with __counted_by_ptr Add the __counted_by_ptr() compiler attribute to ->aliases to improve bounds checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. Signed-off-by: Thorsten Blum Reviewed-by: Luca Ceresoli Signed-off-by: Andi Shyti Link: https://lore.kernel.org/r/20260611215501.464405-3-thorsten.blum@linux.dev --- diff --git a/include/linux/i2c-atr.h b/include/linux/i2c-atr.h index 2bb54dc87c8e5..b52a7b9ec5362 100644 --- a/include/linux/i2c-atr.h +++ b/include/linux/i2c-atr.h @@ -71,7 +71,7 @@ struct i2c_atr_adap_desc { struct device *parent; struct fwnode_handle *bus_handle; size_t num_aliases; - u16 *aliases; + u16 *aliases __counted_by_ptr(num_aliases); }; /**