You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2021/11/05 20:49:24 UTC

[GitHub] [mynewt-core] kasjer commented on a change in pull request #2711: mcu/nrf5340: Add RAM location check to calls using easyDMA

kasjer commented on a change in pull request #2711:
URL: https://github.com/apache/mynewt-core/pull/2711#discussion_r743961480



##########
File path: hw/mcu/nordic/nrf5340_net/src/hal_spi.c
##########
@@ -685,10 +686,14 @@ hal_spi_txrx_noblock(int spi_num, void *txbuf, void *rxbuf, int len)
 {
     struct nrf5340_net_hal_spi *spi = &nrf5340_net_hal_spi0;
 
-    if (spi_num != 0 || (spi->txrx_cb_func == NULL) || (len == 0)) {
+    if (spi_num != 0 || (spi->txrx_cb_func == NULL) || (len == 0) || !nrfx_is_in_ram(txbuf)) {
         return EINVAL;
     }
 
+    if (rxbuf != NULL && !nrfx_is_in_ram(rxbuf)) {
+        return SYS_EINVAL;

Review comment:
       This looks slightly strange to return SYS_EINVAL and EINVAL so close together for similar reason.
   Maybe some unification could be applied, I'm not sure which way though.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org