From: Yoshihiro YUNOMAE Date: Wed, 23 Jul 2014 06:06:22 +0000 (+0000) Subject: serial/core: Fix too big allocation for attribute member X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c2b703b807e3aba4d2b542c9096c790186a6e71f;p=linux-beck.git 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: Yoshihiro YUNOMAE Reported-by: Dan Carpenter Reviewed-by: Daniel Thompson Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 61529a84c3fc..8bb19da01639 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -2618,7 +2618,7 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport) if (uport->attr_group) num_groups++; - uport->tty_groups = kcalloc(num_groups, sizeof(**uport->tty_groups), + uport->tty_groups = kcalloc(num_groups, sizeof(*uport->tty_groups), GFP_KERNEL); if (!uport->tty_groups) { ret = -ENOMEM;