From 3dcc21c8e47c23a0c76f4085df0c8271c20034f5 Mon Sep 17 00:00:00 2001 From: pthierry Date: Wed, 13 Nov 2024 12:34:56 +0100 Subject: [PATCH] uapi: fixing svc exchange mutable address access --- uapi/uapi/svc_exchange.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/uapi/uapi/svc_exchange.rs b/uapi/uapi/svc_exchange.rs index c2112084..2affa753 100644 --- a/uapi/uapi/svc_exchange.rs +++ b/uapi/uapi/svc_exchange.rs @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: 2023 Ledger SAS // SPDX-License-Identifier: Apache-2.0 +use core::ptr::addr_of_mut; use crate::systypes::{EraseMode, EraseType, Status}; /// SVC Exchange area len. TODO: to be kconfig-generated @@ -100,7 +101,7 @@ pub extern "C" fn clean_svcexchange(erasetype: EraseType, mode: EraseMode) -> St _ => return Status::Invalid, } unsafe { - core::ptr::write_volatile(&mut SVC_EXCHANGE_AREA as *mut [u8; SVC_EXCH_AREA_LEN], [0; SVC_EXCH_AREA_LEN]); + core::ptr::write_volatile(addr_of_mut!(SVC_EXCHANGE_AREA) as *mut [u8; SVC_EXCH_AREA_LEN], [0; SVC_EXCH_AREA_LEN]); } Status::Ok }