mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 00:04:15 +08:00
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: 60aaf93385
Reported-by: Ben Hutchings <bhutchings@solarflare.com>
Cc: majianpeng <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
6ce4eac1f6
commit
0c775d5208
@ -5471,7 +5471,7 @@ static int alloc_thread_groups(struct r5conf *conf, int cnt,
|
|||||||
for (i = 0; i < *group_cnt; i++) {
|
for (i = 0; i < *group_cnt; i++) {
|
||||||
struct r5worker_group *group;
|
struct r5worker_group *group;
|
||||||
|
|
||||||
group = worker_groups[i];
|
group = &(*worker_groups)[i];
|
||||||
INIT_LIST_HEAD(&group->handle_list);
|
INIT_LIST_HEAD(&group->handle_list);
|
||||||
group->conf = conf;
|
group->conf = conf;
|
||||||
group->workers = workers + i * cnt;
|
group->workers = workers + i * cnt;
|
||||||
|
Loading…
Reference in New Issue
Block a user