mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
pinctrl: starfive: jh7110: Use __counted_by() flexarray
Flexible arrays should use __counted_by() to be able to do
runtime checks that the array does not go out of range.
Cc: Rosen Penev <rosenp@gmail.com>
Fixes: 87182ef0bf ("pinctrl: starfive: jh7110: use struct_size")
Signed-off-by: Linus Walleij <linusw@kernel.org>
This commit is contained in:
parent
4af4eb66aa
commit
50bb01954a
|
|
@ -865,6 +865,7 @@ int jh7110_pinctrl_probe(struct platform_device *pdev)
|
|||
#endif
|
||||
if (!sfp)
|
||||
return -ENOMEM;
|
||||
sfp->num_saved_regs = info->nsaved_regs;
|
||||
|
||||
sfp->base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(sfp->base))
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@ struct jh7110_pinctrl {
|
|||
/* register read/write mutex */
|
||||
struct mutex mutex;
|
||||
const struct jh7110_pinctrl_soc_info *info;
|
||||
u32 saved_regs[];
|
||||
unsigned int num_saved_regs;
|
||||
u32 saved_regs[] __counted_by(num_saved_regs);
|
||||
};
|
||||
|
||||
struct jh7110_gpio_irq_reg {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user