Skip to content

Commit

Permalink
drivers: eth: stm32: Fix invalid assertion comparison
Browse files Browse the repository at this point in the history
The check for assertion on the "config_func" was added to
validate that the function pointer is valid. However, in
the code we are invoking the "config_func" and comparing
its output with NULL. This causes build failures with
CONFIG_ASSERT=1. Caused by PR-25393.

Tested on Nucleo F767Zi board.

Fixes #25427

Signed-off-by: Bilal Wasim <bilalwasim676@gmail.com>
  • Loading branch information
bwasim authored and carlescufi committed May 19, 2020
1 parent 32f351a commit 190ade9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_stm32_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ static void eth_iface_init(struct net_if *iface)
dev_data->iface = iface;

/* Now that the iface is setup, we are safe to enable IRQs. */
__ASSERT_NO_MSG(DEV_CFG(dev)->config_func() != NULL);
__ASSERT_NO_MSG(DEV_CFG(dev)->config_func != NULL);
DEV_CFG(dev)->config_func();
}

Expand Down

0 comments on commit 190ade9

Please sign in to comment.