diff options
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/ds.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 47cab31ff6e4..8f2bb01b098f 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -828,7 +828,6 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename) | |||
828 | { | 828 | { |
829 | struct pcmcia_socket *s = dev->socket; | 829 | struct pcmcia_socket *s = dev->socket; |
830 | const struct firmware *fw; | 830 | const struct firmware *fw; |
831 | char path[FIRMWARE_NAME_MAX]; | ||
832 | int ret = -ENOMEM; | 831 | int ret = -ENOMEM; |
833 | int no_funcs; | 832 | int no_funcs; |
834 | int old_funcs; | 833 | int old_funcs; |
@@ -839,16 +838,7 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename) | |||
839 | 838 | ||
840 | ds_dev_dbg(1, &dev->dev, "trying to load CIS file %s\n", filename); | 839 | ds_dev_dbg(1, &dev->dev, "trying to load CIS file %s\n", filename); |
841 | 840 | ||
842 | if (strlen(filename) > (FIRMWARE_NAME_MAX - 1)) { | 841 | if (request_firmware(&fw, filename, &dev->dev) == 0) { |
843 | dev_printk(KERN_WARNING, &dev->dev, | ||
844 | "pcmcia: CIS filename is too long [%s]\n", | ||
845 | filename); | ||
846 | return -EINVAL; | ||
847 | } | ||
848 | |||
849 | snprintf(path, sizeof(path), "%s", filename); | ||
850 | |||
851 | if (request_firmware(&fw, path, &dev->dev) == 0) { | ||
852 | if (fw->size >= CISTPL_MAX_CIS_SIZE) { | 842 | if (fw->size >= CISTPL_MAX_CIS_SIZE) { |
853 | ret = -EINVAL; | 843 | ret = -EINVAL; |
854 | dev_printk(KERN_ERR, &dev->dev, | 844 | dev_printk(KERN_ERR, &dev->dev, |