Commit c2b703b8 authored by Yoshihiro YUNOMAE's avatar Yoshihiro YUNOMAE Committed by Greg Kroah-Hartman

serial/core: Fix too big allocation for attribute member

Current code allocates too much data for tty_groups member of uart_port struct,
so fix it.
Signed-off-by: default avatarYoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 48479148
...@@ -2618,7 +2618,7 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport) ...@@ -2618,7 +2618,7 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport)
if (uport->attr_group) if (uport->attr_group)
num_groups++; num_groups++;
uport->tty_groups = kcalloc(num_groups, sizeof(**uport->tty_groups), uport->tty_groups = kcalloc(num_groups, sizeof(*uport->tty_groups),
GFP_KERNEL); GFP_KERNEL);
if (!uport->tty_groups) { if (!uport->tty_groups) {
ret = -ENOMEM; ret = -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment