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>
这个提交包含在:
@@ -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:
|
||||
|
在新工单中引用
屏蔽一个用户