Skip to content
Snippets Groups Projects
Commit d9986292 authored by Florian Pose's avatar Florian Pose
Browse files

Minor fix: Set eeprom_size to 0 on unsuccessful memory allocation.

parent 44208f53
No related branches found
No related tags found
No related merge requests found
...@@ -427,8 +427,9 @@ alloc_eeprom: ...@@ -427,8 +427,9 @@ alloc_eeprom:
} }
if (!(slave->eeprom_data = if (!(slave->eeprom_data =
(uint8_t *) kmalloc(slave->eeprom_size, GFP_ATOMIC))) { (uint8_t *) kmalloc(slave->eeprom_size, GFP_ATOMIC))) {
fsm->slave->error_flag = 1; slave->eeprom_size = 0;
slave->error_flag = 1;
fsm->state = ec_fsm_slave_state_error; fsm->state = ec_fsm_slave_state_error;
EC_ERR("Failed to allocate EEPROM data on slave %i.\n", EC_ERR("Failed to allocate EEPROM data on slave %i.\n",
slave->ring_position); slave->ring_position);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment