summaryrefslogtreecommitdiff
path: root/drivers/staging/brcm80211
diff options
context:
space:
mode:
authorThomas Meyer <thomas@m3y3r.de>2011-08-06 11:17:20 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-23 13:13:17 -0700
commitfe39f945bac555165962b58f0cafa5fbfa3d5724 (patch)
tree2f093004a1511a364d3a4cc54c0e6b2b6dafed7a /drivers/staging/brcm80211
parent5349d3d880cdfdeda918f6e84e490f2e86f9d810 (diff)
staging: brcm80211: use kstrdup()
Use kstrdup rather than duplicating its implementation The semantic patch that makes this output is available in scripts/coccinelle/api/kstrdup.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/brcm80211')
-rw-r--r--drivers/staging/brcm80211/brcmfmac/dhd_common.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index a6704c43a81..bd655a31087 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -928,7 +928,7 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
int i = 0;
char *arg_save = 0, *arg_org = 0;
- arg_save = kmalloc(strlen(arg) + 1, GFP_ATOMIC);
+ arg_save = kstrdup(arg, GFP_ATOMIC);
if (!arg_save) {
BRCMF_ERROR(("%s: kmalloc failed\n", __func__));
goto fail;
@@ -942,8 +942,6 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
goto fail;
}
- strcpy(arg_save, arg);
-
argv[i] = strsep(&arg_save, " ");
while (argv[i++])
argv[i] = strsep(&arg_save, " ");