diff --git a/drivers/note/note_driver.c b/drivers/note/note_driver.c index 0a20969e4f5a3..8221e0432783f 100644 --- a/drivers/note/note_driver.c +++ b/drivers/note/note_driver.c @@ -1504,7 +1504,10 @@ void sched_note_event_ip(uint32_t tag, uintptr_t ip, uint8_t event, note_common(tcb, ¬e->nev_cmn, length, event); note->nev_ip = ip; - memcpy(note->nev_data, buf, length - SIZEOF_NOTE_EVENT(0)); + if (buf != NULL) + { + memcpy(note->nev_data, buf, length - SIZEOF_NOTE_EVENT(0)); + } } /* Add the note to circular buffer */