projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
df6be79
)
pcmcia: use kstrdup() in pcmcia_device_query()
author
Geliang Tang
<geliangtang@163.com>
Thu, 1 Oct 2015 16:37:57 +0000
(
00:37
+0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Mon, 5 Oct 2015 03:47:09 +0000
(
04:47
+0100)
Use kstrdup instead of kmalloc and strncpy.
Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pcmcia/ds.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/pcmcia/ds.c
b/drivers/pcmcia/ds.c
index 0decee6c556e88c8f9bb30fd6f604f69c89d50f0..489ea1098c96170ad532a636bf93a148b1228a97 100644
(file)
--- a/
drivers/pcmcia/ds.c
+++ b/
drivers/pcmcia/ds.c
@@
-468,12
+468,10
@@
static int pcmcia_device_query(struct pcmcia_device *p_dev)
if ((length < 2) || (length > 255))
continue;
- new = k
malloc(sizeof(char) * length
, GFP_KERNEL);
+ new = k
strdup(tmp
, GFP_KERNEL);
if (!new)
continue;
- new = strncpy(new, tmp, length);
-
tmp = p_dev->prod_id[i];
p_dev->prod_id[i] = new;
kfree(tmp);