Skip to content

Commit

Permalink
md/raid5: fix new memory-reference bug in alloc_thread_groups.
Browse files Browse the repository at this point in the history
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: 60aaf93
Reported-by: Ben Hutchings <[email protected]>
Cc: majianpeng <[email protected]>
Signed-off-by: NeilBrown <[email protected]>
  • Loading branch information
neilbrown committed Nov 28, 2013
1 parent 6ce4eac commit 0c775d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0c775d5

Please sign in to comment.