From 67cb2e3cdc9495ab00ad13c2971222c3da7bb78e Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sat, 14 Jan 2023 18:50:15 +0000 Subject: Add core_get_data_pinned(), use it where possible Change-Id: I1b2f62f27780f99423085d2fffc972ea2701f998 --- apps/core_keymap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'apps/core_keymap.c') diff --git a/apps/core_keymap.c b/apps/core_keymap.c index 966f32057a..89e7913c33 100644 --- a/apps/core_keymap.c +++ b/apps/core_keymap.c @@ -80,11 +80,12 @@ int core_load_key_remap(const char *filename) int handle = core_alloc(bufsize); if (handle > 0) { - core_pin(handle); - if (read(fd, core_get_data(handle), bufsize) == (ssize_t)bufsize) + void *data = core_get_data_pinned(handle); + + if (read(fd, data, bufsize) == (ssize_t)bufsize) count = action_set_keymap_handle(handle, count); - core_unpin(handle); + core_put_data_pinned(data); } close(fd); -- cgit v1.2.3