Minor fix: Set eeprom_size to 0 on unsuccessful memory allocation.
--- a/master/fsm_slave.c Wed Sep 19 08:24:25 2007 +0000
+++ b/master/fsm_slave.c Wed Sep 19 09:07:36 2007 +0000
@@ -427,8 +427,9 @@
}
if (!(slave->eeprom_data =
- (uint8_t *) kmalloc(slave->eeprom_size, GFP_ATOMIC))) {
- fsm->slave->error_flag = 1;
+ (uint8_t *) kmalloc(slave->eeprom_size, GFP_ATOMIC))) {
+ slave->eeprom_size = 0;
+ slave->error_flag = 1;
fsm->state = ec_fsm_slave_state_error;
EC_ERR("Failed to allocate EEPROM data on slave %i.\n",
slave->ring_position);