aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/generic_nvram.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/generic_nvram.c')
-rw-r--r--drivers/char/generic_nvram.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/generic_nvram.c b/drivers/char/generic_nvram.c
index 0e941b57482e..6c4f4b5a9dd3 100644
--- a/drivers/char/generic_nvram.c
+++ b/drivers/char/generic_nvram.c
@@ -34,12 +34,16 @@ static ssize_t nvram_len;
34static loff_t nvram_llseek(struct file *file, loff_t offset, int origin) 34static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
35{ 35{
36 switch (origin) { 36 switch (origin) {
37 case 0:
38 break;
37 case 1: 39 case 1:
38 offset += file->f_pos; 40 offset += file->f_pos;
39 break; 41 break;
40 case 2: 42 case 2:
41 offset += nvram_len; 43 offset += nvram_len;
42 break; 44 break;
45 default:
46 offset = -1;
43 } 47 }
44 if (offset < 0) 48 if (offset < 0)
45 return -EINVAL; 49 return -EINVAL;