Skip to content

Fix uninitialized handler pointer in FastModels ethernet driver #8996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions targets/TARGET_ARM_FM/TARGET_FVP_MPS2/drivers/lan91c111.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "lan91c111.h"
#include <stddef.h>

static lan91_handle_t *lan91c111_handle;
static lan91_handle_t lan91c111_handle;

void LAN91_init(void)
{
Expand Down Expand Up @@ -95,8 +95,8 @@ void read_MACaddr(uint8_t *addr)
void LAN91_SetCallback(lan91_callback_t callback, void *userData)
{
/* Set callback and userData. */
lan91c111_handle->callback = callback;
lan91c111_handle->userData = userData;
lan91c111_handle.callback = callback;
lan91c111_handle.userData = userData;
}


Expand Down Expand Up @@ -216,8 +216,8 @@ void ETHERNET_Handler(void)
if ((LREG(uint8_t, B2_IST) & IST_RCV) != 0) {
LREG(uint8_t, B2_MSK) = 0;
/* Callback function. */
if (lan91c111_handle->callback) {
lan91c111_handle->callback(LAN91_RxEvent, lan91c111_handle->userData);
if (lan91c111_handle.callback) {
lan91c111_handle.callback(LAN91_RxEvent, lan91c111_handle.userData);
}
}
}
Expand Down