Patch "md/raid1: fix error: ISO C90 forbids mixed declarations" has been added to the 4.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    md/raid1: fix error: ISO C90 forbids mixed declarations

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     md-raid1-fix-error-iso-c90-forbids-mixed-declaration.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit a64e2f9d7bae66f808cee3bd020c8d6061f6af98
Author: Nigel Croxon <ncroxon@xxxxxxxxxx>
Date:   Mon Sep 11 14:25:23 2023 -0700

    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@xxxxxxxxxx>
    Signed-off-by: Song Liu <song@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/46d929d0-2aab-4cf2-b2bf-338963e8ba5a@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 3e54b6639e213..7e37e4b2ec6ae 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1775,12 +1775,11 @@ static int raid1_remove_disk(struct mddev *mddev, struct md_rdev *rdev)
 	struct r1conf *conf = mddev->private;
 	int err = 0;
 	int number = rdev->raid_disk;
+	struct raid1_info *p = conf->mirrors + number;
 
 	if (unlikely(number >= conf->raid_disks))
 		goto abort;
 
-	struct raid1_info *p = conf->mirrors + number;
-
 	if (rdev != p->rdev)
 		p = conf->mirrors + conf->raid_disks + number;
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux