Skip to content
Commit 421a7047 authored by Eric Ackermann's avatar Eric Ackermann Committed by Benjamin Cabé
Browse files

net: gPTP: Fix pointer type in gptp_add_port



The number of ports in gptp_domain.default_ds.nb_ports is a uint8_t.
A pointer to it is passed to gptp_add_port.
However, in this method, the pointer is cast to an int pointer.
The C compiler generates an int-size store for this.
In addition to potentially overwriting adjacent attributes, on platforms
such as RISC-V that do not support unaligned accesses, this causes an
exception on access.
This commit casts nb_ports to the correct type, uint8_t.

Signed-off-by: default avatarEric Ackermann <eric.ackermann@cispa.de>
parent 833bb667
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment