Skip to content

Commit 05bad36

Browse files
RoelKluinvapier
authored andcommitted
Blackfin: fix memset in smp_send_reschedule() and -stop()
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>
1 parent 46b60fa commit 05bad36

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

  • arch/blackfin/mach-common

‎arch/blackfin/mach-common/smp.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,9 @@ void smp_send_reschedule(int cpu)
276276
if (cpu_is_offline(cpu))
277277
return;
278278

279-
msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
279+
msg = kzalloc(sizeof(*msg), GFP_ATOMIC);
280280
if (!msg)
281281
return;
282-
memset(msg, 0, sizeof(msg));
283282
INIT_LIST_HEAD(&msg->list);
284283
msg->type = BFIN_IPI_RESCHEDULE;
285284

@@ -305,10 +304,9 @@ void smp_send_stop(void)
305304
if (cpus_empty(callmap))
306305
return;
307306

308-
msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
307+
msg = kzalloc(sizeof(*msg), GFP_ATOMIC);
309308
if (!msg)
310309
return;
311-
memset(msg, 0, sizeof(msg));
312310
INIT_LIST_HEAD(&msg->list);
313311
msg->type = BFIN_IPI_CPU_STOP;
314312

0 commit comments

Comments
 (0)