diff options
author | Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> | 2013-10-28 13:05:16 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-29 19:24:33 -0400 |
commit | 95f774c5268843e78fdb732cd4f27e510bbbba83 (patch) | |
tree | 3365a712921f2610c7f5ac21d4c4545f5d8dd058 /drivers/misc/eeprom | |
parent | 5c6d6fd1564138ad048564e48639f842714a90c6 (diff) |
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: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/eeprom')
-rw-r--r-- | drivers/misc/eeprom/eeprom_93xx46.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/eeprom/eeprom_93xx46.c b/drivers/misc/eeprom/eeprom_93xx46.c index 94cfc1212577..3a015abb444a 100644 --- a/drivers/misc/eeprom/eeprom_93xx46.c +++ b/drivers/misc/eeprom/eeprom_93xx46.c | |||
@@ -202,7 +202,7 @@ eeprom_93xx46_bin_write(struct file *filp, struct kobject *kobj, | |||
202 | edev = dev_get_drvdata(dev); | 202 | edev = dev_get_drvdata(dev); |
203 | 203 | ||
204 | if (unlikely(off >= edev->bin.size)) | 204 | if (unlikely(off >= edev->bin.size)) |
205 | return 0; | 205 | return -EFBIG; |
206 | if ((off + count) > edev->bin.size) | 206 | if ((off + count) > edev->bin.size) |
207 | count = edev->bin.size - off; | 207 | count = edev->bin.size - off; |
208 | if (unlikely(!count)) | 208 | if (unlikely(!count)) |