diff options
Diffstat (limited to 'drivers/misc/eeprom')
-rw-r--r-- | drivers/misc/eeprom/at24.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c index 5d4fd69d04ca..94b8a3324319 100644 --- a/drivers/misc/eeprom/at24.c +++ b/drivers/misc/eeprom/at24.c | |||
@@ -428,6 +428,9 @@ static ssize_t at24_bin_write(struct file *filp, struct kobject *kobj, | |||
428 | { | 428 | { |
429 | struct at24_data *at24; | 429 | struct at24_data *at24; |
430 | 430 | ||
431 | if (unlikely(off >= attr->size)) | ||
432 | return -EFBIG; | ||
433 | |||
431 | at24 = dev_get_drvdata(container_of(kobj, struct device, kobj)); | 434 | at24 = dev_get_drvdata(container_of(kobj, struct device, kobj)); |
432 | return at24_write(at24, buf, off, count); | 435 | return at24_write(at24, buf, off, count); |
433 | } | 436 | } |