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]
Message-ID: <20101124193814.16425.9000.stgit@bob.linux.org.uk>
Date:	Wed, 24 Nov 2010 19:38:21 +0000
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	greg@...ah.com, mark.a.allyn@...el.com,
	linux-kernel@...r.kernel.org
Subject: [PATCH 08/12] sep: Use kzalloc when needed

From: Alan Cox <alan@...ux.intel.com>

Signed-off-by: Alan Cox <alan@...ux.intel.com>
---

 drivers/staging/sep/sep_driver.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)


diff --git a/drivers/staging/sep/sep_driver.c b/drivers/staging/sep/sep_driver.c
index f576285..ff9df36 100644
--- a/drivers/staging/sep/sep_driver.c
+++ b/drivers/staging/sep/sep_driver.c
@@ -3343,16 +3343,13 @@ static int __devinit sep_probe(struct pci_dev *pdev,
 	}
 
 	/* allocate the sep_device structure for this device */
-	sep_dev = kmalloc(sizeof(struct sep_device), GFP_ATOMIC);
+	sep_dev = kzalloc(sizeof(struct sep_device), GFP_ATOMIC);
 	if (sep_dev == NULL) {
 		dev_warn(&pdev->dev,
 			"can't kmalloc the sep_device structure\n");
 		return -ENOMEM;
 	}
 
-	/* zero out sep structure */
-	memset((void *)sep_dev, 0, sizeof(struct sep_device));
-
 	/*
 	 * we're going to use another variable for actually
 	 * working with the device; this way, if we have
@@ -3365,8 +3362,6 @@ static int __devinit sep_probe(struct pci_dev *pdev,
 
 	if (pdev->device == MRST_PCI_DEVICE_ID)
 		sep->mrst = 1;
-	else
-		sep->mrst = 0;
 
 	dev_dbg(&sep->pdev->dev, "PCI obtained, device being prepared\n");
 	dev_dbg(&sep->pdev->dev, "revision is %d\n", sep->pdev->revision);
@@ -3423,7 +3418,6 @@ static int __devinit sep_probe(struct pci_dev *pdev,
 			goto end_function_deallocate_sep_shared_area;
 		}
 	} else {
-
 		sep->rar_size = FAKE_RAR_SIZE;
 		sep->rar_addr = dma_alloc_coherent(NULL,
 			sep->rar_size, &sep->rar_bus, GFP_KERNEL);

--
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