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

Commit 95f774c5 authored by Vladimir Zapolskiy's avatar Vladimir Zapolskiy Committed by Greg Kroah-Hartman
Browse files

misc/93xx46: avoid infinite loop on write()



This change fixes a problem of infinite zero byte write() without
an error status, if there is an attempt to write a file bigger than
EEPROM size over sysfs interface.

Signed-off-by: default avatarVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5c6d6fd1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ eeprom_93xx46_bin_write(struct file *filp, struct kobject *kobj,
	edev = dev_get_drvdata(dev);

	if (unlikely(off >= edev->bin.size))
		return 0;
		return -EFBIG;
	if ((off + count) > edev->bin.size)
		count = edev->bin.size - off;
	if (unlikely(!count))