summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pcmcia/ds.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 0decee6c556e..489ea1098c96 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -468,12 +468,10 @@ static int pcmcia_device_query(struct pcmcia_device *p_dev)
468 if ((length < 2) || (length > 255)) 468 if ((length < 2) || (length > 255))
469 continue; 469 continue;
470 470
471 new = kmalloc(sizeof(char) * length, GFP_KERNEL); 471 new = kstrdup(tmp, GFP_KERNEL);
472 if (!new) 472 if (!new)
473 continue; 473 continue;
474 474
475 new = strncpy(new, tmp, length);
476
477 tmp = p_dev->prod_id[i]; 475 tmp = p_dev->prod_id[i];
478 p_dev->prod_id[i] = new; 476 p_dev->prod_id[i] = new;
479 kfree(tmp); 477 kfree(tmp);