[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <db26819b-ac42-9e73-c95c-aecbbd96cd98@users.sourceforge.net>
Date: Fri, 8 Dec 2017 19:12:33 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-serial@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jslaby@...e.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH 4/4] serial: pch_uart: Improve a size determination in
pch_uart_init_port()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Fri, 8 Dec 2017 18:53:21 +0100
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/tty/serial/pch_uart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 790a7aae331f..1c30309ef02c 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -1747,7 +1747,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
board = &drv_dat[id->driver_data];
port_type = board->port_type;
- priv = kzalloc(sizeof(struct eg20t_port), GFP_KERNEL);
+ priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (priv == NULL)
goto init_port_alloc_err;
--
2.15.1
Powered by blists - more mailing lists