EEPROM size calculated in 16-bit words, so we should take into account
this fact during buffer allocation.
CC: Jiri Slaby <jirislaby@gmail.com>
CC: Nick Kossifidis <mickflemm@gmail.com>
CC: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
        struct ath5k_hw *ah = inode->i_private;
        bool res;
        int i, ret;
-       u32 eesize;
+       u32 eesize;     /* NB: in 16-bit words */
        u16 val, *buf;
 
        /* Get eeprom size */
 
        /* Create buffer and read in eeprom */
 
-       buf = vmalloc(eesize);
+       buf = vmalloc(eesize * 2);
        if (!buf) {
                ret = -ENOMEM;
                goto err;
        }
 
        ep->buf = buf;
-       ep->len = i;
+       ep->len = eesize * 2;
 
        file->private_data = (void *)ep;