[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1382979916-3494-3-git-send-email-vladimir_zapolskiy@mentor.com>
Date: Mon, 28 Oct 2013 19:05:16 +0200
From: Vladimir Zapolskiy <vladimir_zapolskiy@...tor.com>
To: <linux-kernel@...r.kernel.org>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: [PATCH 2/2] 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@...tor.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/misc/eeprom/eeprom_93xx46.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/eeprom/eeprom_93xx46.c b/drivers/misc/eeprom/eeprom_93xx46.c
index 94cfc12..3a015ab 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,
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))
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists