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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 19 Jul 2014 11:55:40 +0200
From:	LABBE Corentin <clabbe.montjoie@...il.com>
To:	gregkh@...uxfoundation.org, monamagarwal123@...il.com,
	paul.gortmaker@...driver.com, jg1.han@...sung.com,
	paulmck@...ux.vnet.ibm.com, valentina.manea.m@...il.com,
	jack@...e.cz
Cc:	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
	LABBE Corentin <clabbe.montjoie@...il.com>
Subject: [PATCH 1/4] Solves some problems reported by checkpatch

Signed-off-by: LABBE Corentin <clabbe.montjoie@...il.com>
---
 drivers/staging/sep/sep_main.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/sep/sep_main.c b/drivers/staging/sep/sep_main.c
index 75ca15e..177e4b9 100644
--- a/drivers/staging/sep/sep_main.c
+++ b/drivers/staging/sep/sep_main.c
@@ -155,7 +155,7 @@ struct sep_queue_info *sep_queue_status_add(
 	unsigned long lck_flags;
 	struct sep_queue_info *my_elem = NULL;
 
-	my_elem = kzalloc(sizeof(struct sep_queue_info), GFP_KERNEL);
+	my_elem = kzalloc(sizeof(*my_elem), GFP_KERNEL);
 
 	if (!my_elem)
 		return NULL;
@@ -1006,8 +1006,8 @@ static int sep_crypto_dma(
 		return -ENOMEM;
 	}
 
-	sep_dma = kmalloc(sizeof(struct sep_dma_map) *
-		count_mapped, GFP_ATOMIC);
+	sep_dma = kmalloc_array(count_mapped, sizeof(struct sep_dma_map),
+			GFP_ATOMIC);
 
 	if (sep_dma == NULL) {
 		dev_dbg(&sep->pdev->dev, "Cannot allocate dma_maps\n");
@@ -1070,7 +1070,8 @@ static int sep_crypto_lli(
 
 	sep_map = *maps;
 
-	sep_lli = kmalloc(sizeof(struct sep_lli_entry) * nbr_ents, GFP_ATOMIC);
+	sep_lli = kmalloc_array(nbr_ents, sizeof(struct sep_lli_entry),
+			GFP_ATOMIC);
 
 	if (sep_lli == NULL) {
 		dev_dbg(&sep->pdev->dev, "Cannot allocate lli_maps\n");
@@ -3398,7 +3399,7 @@ static ssize_t sep_create_dcb_dmatables_context(struct sep_device *sep,
 	}
 
 	/* Allocate thread-specific memory for DCB */
-	*dcb_region = kzalloc(num_dcbs * sizeof(struct sep_dcblock),
+	*dcb_region = kcalloc(num_dcbs, sizeof(struct sep_dcblock),
 			      GFP_KERNEL);
 	if (!(*dcb_region)) {
 		error = -ENOMEM;
@@ -3480,7 +3481,7 @@ int sep_create_dcb_dmatables_context_kernel(struct sep_device *sep,
 		current->pid, num_dcbs);
 
 	/* Allocate thread-specific memory for DCB */
-	*dcb_region = kzalloc(num_dcbs * sizeof(struct sep_dcblock),
+	*dcb_region = kcalloc(num_dcbs, sizeof(struct sep_dcblock),
 			      GFP_KERNEL);
 	if (!(*dcb_region)) {
 		error = -ENOMEM;
@@ -4090,7 +4091,7 @@ static int sep_probe(struct pci_dev *pdev,
 	}
 
 	/* Allocate the sep_device structure for this device */
-	sep_dev = kzalloc(sizeof(struct sep_device), GFP_ATOMIC);
+	sep_dev = kzalloc(sizeof(*sep_dev), GFP_ATOMIC);
 	if (sep_dev == NULL) {
 		error = -ENOMEM;
 		goto end_function_disable_device;
-- 
1.8.5.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ