From: Randy Dunlap Date: Tue, 5 Feb 2008 06:27:38 +0000 (-0800) Subject: pcmcia: include bad CIS filename in error message X-Git-Tag: v2.6.25-rc1~1035 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=52debb06238b8076ec2667359668d4c5e38e8807;p=~emulex%2Finfiniband.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 846468ce114..5a85871f5ee 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -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) {