Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c775d52 authored by NeilBrown's avatar NeilBrown
Browse files

md/raid5: fix new memory-reference bug in alloc_thread_groups.



In alloc_thread_groups, worker_groups is a pointer to an array,
not an array of pointers.
So
   worker_groups[i]
is wrong.  It should be
   &(*worker_groups)[i]

Found-by: coverity
Fixes: 60aaf933
Reported-by: default avatarBen Hutchings <bhutchings@solarflare.com>
Cc: majianpeng <majianpeng@gmail.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 6ce4eac1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5471,7 +5471,7 @@ static int alloc_thread_groups(struct r5conf *conf, int cnt,
	for (i = 0; i < *group_cnt; i++) {
		struct r5worker_group *group;

		group = worker_groups[i];
		group = &(*worker_groups)[i];
		INIT_LIST_HEAD(&group->handle_list);
		group->conf = conf;
		group->workers = workers + i * cnt;