Skip to content

Commit

Permalink
Blackfin: fix memset in smp_send_reschedule() and -stop()
Browse files Browse the repository at this point in the history
To set zeroes the sizeof the struct should be used rather
than sizeof the pointer, kzalloc does that.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
  • Loading branch information
Roel Kluin authored and Mike Frysinger committed Nov 25, 2009
1 parent 46b60fa commit 05bad36
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions arch/blackfin/mach-common/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,9 @@ void smp_send_reschedule(int cpu)
if (cpu_is_offline(cpu))
return;

msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
msg = kzalloc(sizeof(*msg), GFP_ATOMIC);
if (!msg)
return;
memset(msg, 0, sizeof(msg));
INIT_LIST_HEAD(&msg->list);
msg->type = BFIN_IPI_RESCHEDULE;

Expand All @@ -305,10 +304,9 @@ void smp_send_stop(void)
if (cpus_empty(callmap))
return;

msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
msg = kzalloc(sizeof(*msg), GFP_ATOMIC);
if (!msg)
return;
memset(msg, 0, sizeof(msg));
INIT_LIST_HEAD(&msg->list);
msg->type = BFIN_IPI_CPU_STOP;

Expand Down

0 comments on commit 05bad36

Please sign in to comment.