linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial/core: Fix too big allocation for attribute member
@ 2014-07-23  6:06 Yoshihiro YUNOMAE
  2014-07-23  8:10 ` Daniel Thompson
  0 siblings, 1 reply; 2+ messages in thread
From: Yoshihiro YUNOMAE @ 2014-07-23  6:06 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Dan Carpenter
  Cc: linux-kernel, linux-serial, yrl.pp-manager.tt

Current code allocates too much data for tty_groups member of uart_port struct,
so fix it.

Signed-off-by: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CC: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/tty/serial/serial_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 4af764c..8ded213 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2617,7 +2617,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;


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] serial/core: Fix too big allocation for attribute member
  2014-07-23  6:06 [PATCH] serial/core: Fix too big allocation for attribute member Yoshihiro YUNOMAE
@ 2014-07-23  8:10 ` Daniel Thompson
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Thompson @ 2014-07-23  8:10 UTC (permalink / raw)
  To: Yoshihiro YUNOMAE, Greg Kroah-Hartman, Dan Carpenter
  Cc: linux-kernel, linux-serial, yrl.pp-manager.tt

On 23/07/14 07:06, Yoshihiro YUNOMAE wrote:
> Current code allocates too much data for tty_groups member of uart_port struct,
> so fix it.
> 
> Signed-off-by: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
> CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> CC: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>

(using linux-next tree for context).

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-23  8:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-23  6:06 [PATCH] serial/core: Fix too big allocation for attribute member Yoshihiro YUNOMAE
2014-07-23  8:10 ` Daniel Thompson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).