Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;