Skip to content

Commit b05d719

Browse files
decsnynashif
authored andcommitted
drivers: nxp_enet: Fix CID 392512
This commit fixes coverity issue 392512. The issue was that the return value of clock_control_on was not being checked. Fix by checking the return value. Signed-off-by: Declan Snyder <[email protected]>
1 parent f4dbe52 commit b05d719

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/ethernet/nxp_enet/eth_nxp_enet.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,8 +1010,13 @@ struct nxp_enet_mod_data {
10101010
static int nxp_enet_mod_init(const struct device *dev)
10111011
{
10121012
const struct nxp_enet_mod_config *config = dev->config;
1013+
int ret;
10131014

1014-
clock_control_on(config->clock_dev, config->clock_subsys);
1015+
ret = clock_control_on(config->clock_dev, config->clock_subsys);
1016+
if (ret) {
1017+
LOG_ERR("ENET module clock error");
1018+
return ret;
1019+
}
10151020

10161021
DEVICE_MMIO_MAP(dev, K_MEM_CACHE_NONE | K_MEM_DIRECT_MAP);
10171022

0 commit comments

Comments
 (0)