Skip to content

Commit

Permalink
staging: brcm80211: use kstrdup()
Browse files Browse the repository at this point in the history
 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>
  • Loading branch information
Thomas Meyer authored and Greg Kroah-Hartman committed Aug 23, 2011
1 parent 5349d3d commit fe39f94
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/staging/brcm80211/brcmfmac/dhd_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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, " ");
Expand Down

0 comments on commit fe39f94

Please sign in to comment.