Skip to content

Commit 0e3d712

Browse files
author
Cruz Monrreal
authored
Merge pull request #8996 from jamesbeyond/fm_eth_fix
Fix uninitialized handler pointer in FastModels ethernet driver
2 parents 4a8e2de + f8edab1 commit 0e3d712

File tree

1 file changed

+5
-5
lines changed
  • targets/TARGET_ARM_FM/TARGET_FVP_MPS2/drivers

1 file changed

+5
-5
lines changed

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/drivers/lan91c111.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "lan91c111.h"
1919
#include <stddef.h>
2020

21-
static lan91_handle_t *lan91c111_handle;
21+
static lan91_handle_t lan91c111_handle;
2222

2323
void LAN91_init(void)
2424
{
@@ -95,8 +95,8 @@ void read_MACaddr(uint8_t *addr)
9595
void LAN91_SetCallback(lan91_callback_t callback, void *userData)
9696
{
9797
/* Set callback and userData. */
98-
lan91c111_handle->callback = callback;
99-
lan91c111_handle->userData = userData;
98+
lan91c111_handle.callback = callback;
99+
lan91c111_handle.userData = userData;
100100
}
101101

102102

@@ -216,8 +216,8 @@ void ETHERNET_Handler(void)
216216
if ((LREG(uint8_t, B2_IST) & IST_RCV) != 0) {
217217
LREG(uint8_t, B2_MSK) = 0;
218218
/* Callback function. */
219-
if (lan91c111_handle->callback) {
220-
lan91c111_handle->callback(LAN91_RxEvent, lan91c111_handle->userData);
219+
if (lan91c111_handle.callback) {
220+
lan91c111_handle.callback(LAN91_RxEvent, lan91c111_handle.userData);
221221
}
222222
}
223223
}

0 commit comments

Comments
 (0)