lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250421184144.220972-1-marwinhormiz@gmail.com>
Date: Mon, 21 Apr 2025 20:41:44 +0200
From: Marwin Hormiz <marwinhormiz@...il.com>
To: dpenkler@...il.com,
	gregkh@...uxfoundation.org
Cc: dan.carpenter@...aro.org,
	matchstick@...erthere.org,
	arnd@...db.de,
	niharchaithanya@...il.com,
	linux-staging@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	Marwin Hormiz <marwinhormiz@...il.com>
Subject: [PATCH 1/1] staging: gpib: gpio: Fix memory allocation style in gpib_bitbang.c

Change kzalloc() to use sizeof(*variable) instead of sizeof(struct type)
to improve code maintainability. This follows the kernel coding style
recommendation for memory allocations.

Signed-off-by: Marwin Hormiz <marwinhormiz@...il.com>
---
 drivers/staging/gpib/gpio/gpib_bitbang.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c
index 86bdd381472a..28f2f44deb39 100644
--- a/drivers/staging/gpib/gpio/gpib_bitbang.c
+++ b/drivers/staging/gpib/gpio/gpib_bitbang.c
@@ -46,10 +46,10 @@
 			dev_dbg(board->gpib_dev, frm, ## __VA_ARGS__); } \
 	while (0)
 
-#define LINVAL gpiod_get_value(DAV),		\
+#define LINVAL (gpiod_get_value(DAV),		\
 		gpiod_get_value(NRFD),		\
 		gpiod_get_value(NDAC),		\
-		gpiod_get_value(SRQ)
+		gpiod_get_value(SRQ))
 #define LINFMT "DAV: %d	 NRFD:%d  NDAC: %d SRQ: %d"
 
 #include "gpibP.h"
@@ -1063,7 +1063,7 @@ static int bb_line_status(const struct gpib_board *board)
 
 static int allocate_private(struct gpib_board *board)
 {
-	board->private_data = kzalloc(sizeof(struct bb_priv), GFP_KERNEL);
+	board->private_data = kzalloc(sizeof(*board->private_data), GFP_KERNEL);
 	if (!board->private_data)
 		return -1;
 	return 0;
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ