Skip to content

Commit aefb645

Browse files
tokangasrlubos
authored andcommitted
net: lib: nrf_cloud: Make P-GPS use nrf_cloud_mem hooks
The P-GPS implementation used k_malloc() to allocate memory, while all other allocations in the nRF Cloud library were done using nrf_cloud_mem hooks. Updated also P-GPS to use the mem hooks. Signed-off-by: Tommi Kangas <[email protected]>
1 parent 8fad86d commit aefb645

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

subsys/net/lib/nrf_cloud/src/nrf_cloud_pgps.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
LOG_MODULE_REGISTER(nrf_cloud_pgps, CONFIG_NRF_CLOUD_GPS_LOG_LEVEL);
2626

27+
#include "nrf_cloud_mem.h"
2728
#include "nrf_cloud_transport.h"
2829
#include "nrf_cloud_fsm.h"
2930
#include "nrf_cloud_pgps_schema_v1.h"
@@ -1732,8 +1733,9 @@ int nrf_cloud_pgps_init(struct nrf_cloud_pgps_init_param *param)
17321733
state = PGPS_NONE;
17331734

17341735
if (!write_buf) {
1735-
write_buf = k_malloc(flash_page_size);
1736+
write_buf = nrf_cloud_malloc(flash_page_size);
17361737
if (!write_buf) {
1738+
LOG_ERR("Failed to allocate write buffer");
17371739
return -ENOMEM;
17381740
}
17391741
#if PGPS_DEBUG

0 commit comments

Comments
 (0)