Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f55eacbe authored by Frank Schaefer's avatar Frank Schaefer Committed by Mauro Carvalho Chehab
Browse files

[media] em28xx: do not interpret eeprom content if eeprom key is invalid



If the eeprom key isn't valid, either a different (currently unknown) format
is used or the eeprom is corrupted.
In both cases it doesn't make sense to interpret the data.
Also print an error message.

Signed-off-by: default avatarFrank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent d90f0677
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -434,7 +434,11 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned char *eedata, int len)
			printk("\n");
	}

	if (em_eeprom->id == 0x9567eb1a)
	if (em_eeprom->id != 0x9567eb1a) {
		em28xx_errdev("Unknown eeprom type or eeprom corrupted !");
		return -ENODEV;
	}

	dev->hash = em28xx_hash_mem(eedata, len, 32);

	em28xx_info("EEPROM ID = 0x%08x, EEPROM hash = 0x%08lx\n",