summaryrefslogtreecommitdiff
path: root/nuttx/drivers/mtd/at25.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/drivers/mtd/at25.c')
-rw-r--r--nuttx/drivers/mtd/at25.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/nuttx/drivers/mtd/at25.c b/nuttx/drivers/mtd/at25.c
index c58b16122..6c4e183eb 100644
--- a/nuttx/drivers/mtd/at25.c
+++ b/nuttx/drivers/mtd/at25.c
@@ -2,7 +2,7 @@
* drivers/mtd/at25.c
* Driver for SPI-based AT25DF321 (32Mbit) flash.
*
- * Copyright (C) 2009-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2009-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
* Petteri Aimonen <jpa@nx.mail.kapsi.fi>
*
@@ -664,10 +664,12 @@ FAR struct mtd_dev_s *at25_initialize(FAR struct spi_dev_s *dev)
* to be extended to handle multiple FLASH parts on the same SPI bus.
*/
- priv = (FAR struct at25_dev_s *)kmalloc(sizeof(struct at25_dev_s));
+ priv = (FAR struct at25_dev_s *)kzalloc(sizeof(struct at25_dev_s));
if (priv)
{
- /* Initialize the allocated structure */
+ /* Initialize the allocated structure (unsupported methods were
+ * nullified by kzalloc).
+ */
priv->mtd.erase = at25_erase;
priv->mtd.bread = at25_bread;