diff options
author | Laura Abbott <labbott@redhat.com> | 2018-04-11 04:04:29 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-13 04:46:10 +0300 |
commit | 9a4381618262157586051f5ba0db42df3c6ab4b5 (patch) | |
tree | a34c683d2f32cb6f87a3a554f4cae765cfd5c815 /drivers/isdn/mISDN/dsp_hwec.c | |
parent | b16520f7493d06d8ef6d4255bdfcf7a803d7874a (diff) | |
download | linux-9a4381618262157586051f5ba0db42df3c6ab4b5.tar.xz |
mISDN: Remove VLAs
There's an ongoing effort to remove VLAs[1] from the kernel to eventually
turn on -Wvla. Remove the VLAs from the mISDN code by switching to using
kstrdup in one place and using an upper bound in another.
Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/mISDN/dsp_hwec.c')
-rw-r--r-- | drivers/isdn/mISDN/dsp_hwec.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/isdn/mISDN/dsp_hwec.c b/drivers/isdn/mISDN/dsp_hwec.c index a6e87076acc2..5336bbdbfdc5 100644 --- a/drivers/isdn/mISDN/dsp_hwec.c +++ b/drivers/isdn/mISDN/dsp_hwec.c @@ -68,12 +68,12 @@ void dsp_hwec_enable(struct dsp *dsp, const char *arg) goto _do; { - char _dup[len + 1]; char *dup, *tok, *name, *val; int tmp; - strcpy(_dup, arg); - dup = _dup; + dup = kstrdup(arg, GFP_ATOMIC); + if (!dup) + return; while ((tok = strsep(&dup, ","))) { if (!strlen(tok)) @@ -89,6 +89,8 @@ void dsp_hwec_enable(struct dsp *dsp, const char *arg) deftaps = tmp; } } + + kfree(dup); } _do: |