]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid1: fix error: ISO C90 forbids mixed declarations
authorNigel Croxon <ncroxon@redhat.com>
Mon, 11 Sep 2023 21:25:23 +0000 (14:25 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Sep 2023 09:11:09 +0000 (11:11 +0200)
commitba4f28a1d3626201108439a0272deb3076dbcbb1
treeff3fb65b297acaad5b8d3d2b87bd5658c50f1fd7
parent2076b4b677c31b99e8ce9bcab783ec4fb6adc15b
md/raid1: fix error: ISO C90 forbids mixed declarations

[ Upstream commit df203da47f4428bc286fc99318936416253a321c ]

There is a compile error when this commit is added:
md: raid1: fix potential OOB in raid1_remove_disk()

drivers/md/raid1.c: In function 'raid1_remove_disk':
drivers/md/raid1.c:1844:9: error: ISO C90 forbids mixed declarations
and code [-Werror=declaration-after-statement]
1844 |         struct raid1_info *p = conf->mirrors + number;
     |         ^~~~~~

That's because the new code was inserted before the struct.
The change is move the struct command above this commit.

Fixes: 8b0472b50bcf ("md: raid1: fix potential OOB in raid1_remove_disk()")
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/46d929d0-2aab-4cf2-b2bf-338963e8ba5a@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/raid1.c