[PATCH] pcmcia: include bad CIS filename in error message

Randy Dunlap rdunlap at xenotime.net
Wed Nov 28 18:17:13 EST 2007


From: Randy Dunlap <randy.dunlap at oracle.com>

- 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 at oracle.com>
---
 drivers/pcmcia/ds.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- linux-2.6.24-rc3-git2.orig/drivers/pcmcia/ds.c
+++ linux-2.6.24-rc3-git2/drivers/pcmcia/ds.c
@@ -864,11 +864,12 @@ static int pcmcia_load_firmware(struct p
 	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) {
---
~Randy



More information about the linux-pcmcia mailing list