mirror of
https://github.com/torvalds/linux.git
synced 2024-12-29 06:12:08 +00:00
pcmcia: include bad CIS filename in error message
- Print the invalid CIS filename in the invalid filename message. - Use sizeof() instead of hard-coded constant for buffer size. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
d6b4fa6d69
commit
52debb0623
@ -865,11 +865,12 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename)
|
||||
ds_dbg(1, "trying to load CIS file %s\n", filename);
|
||||
|
||||
if (strlen(filename) > 14) {
|
||||
printk(KERN_WARNING "pcmcia: CIS filename is too long\n");
|
||||
printk(KERN_WARNING "pcmcia: CIS filename is too long [%s]\n",
|
||||
filename);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
snprintf(path, 20, "%s", filename);
|
||||
snprintf(path, sizeof(path), "%s", filename);
|
||||
|
||||
if (request_firmware(&fw, path, &dev->dev) == 0) {
|
||||
if (fw->size >= CISTPL_MAX_CIS_SIZE) {
|
||||
|
Loading…
Reference in New Issue
Block a user