Missing nullptr check for API call in "net/phy.h" #84146
Labels
area: Ethernet
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
Describe the bug
The function
static inline int phy_link_callback_set(const struct device *dev, phy_callback_t callback,void *user_data)
claims to return the error code "-ENOTSUP" if the API call is not supported.But the function misses a correspondung nullptr check.
Current implementation:
Posseblie fix:
To Reproduce
Steps to reproduce the behavior:
phy_link_callback_set
Expected behavior
The function returns -ENOTSUP indicating that the ehternet driver does not support that API call.
Impact
The sample application crashes with a memory/access violation.
Logs and console output
Environment (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: