Add the __counted_by compiler attribute to the flexible array member
entries to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.

Signed-off-by: Hongbo Li <[email protected]>
---
 drivers/mmc/host/sdhci-cadence.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cadence.c
index be1505e8c536..2690bcaeaad5 100644
--- a/drivers/mmc/host/sdhci-cadence.c
+++ b/drivers/mmc/host/sdhci-cadence.c
@@ -73,7 +73,7 @@ struct sdhci_cdns_priv {
        void (*priv_writel)(struct sdhci_cdns_priv *priv, u32 val, void __iomem 
*reg);
        struct reset_control *rst_hw;
        unsigned int nr_phy_params;
-       struct sdhci_cdns_phy_param phy_params[];
+       struct sdhci_cdns_phy_param phy_params[] __counted_by(count);
 };
 
 struct sdhci_cdns_phy_cfg {
-- 
2.34.1


Reply via email to