Skip to content

Commit 7f1989c

Browse files
committed
Check that buffers are in RAM
1 parent c4b7318 commit 7f1989c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

nrf-hal-common/src/uarte.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ where
465465
T: Instance,
466466
{
467467
fn new(tx_buf: &'a mut [u8]) -> Result<UarteTx<'a, T>, Error> {
468+
slice_in_ram_or(tx_buf, Error::BufferNotInRAM)?;
468469
if tx_buf.len() > 0 {
469470
Ok(UarteTx {
470471
_marker: core::marker::PhantomData,
@@ -481,6 +482,7 @@ where
481482
T: Instance,
482483
{
483484
fn new(rx_buf: &'a mut [u8]) -> Result<UarteRx<'a, T>, Error> {
485+
slice_in_ram_or(rx_buf, Error::BufferNotInRAM)?;
484486
if rx_buf.len() > 0 {
485487
Ok(UarteRx {
486488
_marker: core::marker::PhantomData,

0 commit comments

Comments
 (0)