summaryrefslogtreecommitdiff
path: root/src/flash/nand.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-04-02 21:20:35 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-04-02 21:20:35 +0000
commit9a6c3cc87f5f9b01f0f4d57bb81fb3de4f533f23 (patch)
treec0496d1e1d13a44974532c0409c21cf341efc97e /src/flash/nand.c
parent25047d498062340bcbf4902597f070ed3ba5e4ed (diff)
downloadopenocd+libswd-9a6c3cc87f5f9b01f0f4d57bb81fb3de4f533f23.tar.gz
openocd+libswd-9a6c3cc87f5f9b01f0f4d57bb81fb3de4f533f23.tar.bz2
openocd+libswd-9a6c3cc87f5f9b01f0f4d57bb81fb3de4f533f23.tar.xz
openocd+libswd-9a6c3cc87f5f9b01f0f4d57bb81fb3de4f533f23.zip
Nicolas Pitre nico at cam.org Allocating a 6-byte memory location with malloc() is rather silly
when this can be allocated on the stack. git-svn-id: svn://svn.berlios.de/openocd/trunk@1442 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/flash/nand.c')
-rw-r--r--src/flash/nand.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/flash/nand.c b/src/flash/nand.c
index 51755aa0..2b3b5170 100644
--- a/src/flash/nand.c
+++ b/src/flash/nand.c
@@ -317,9 +317,7 @@ int nand_build_bbt(struct nand_device_s *device, int first, int last)
{
u32 page = 0x0;
int i;
- u8 *oob;
-
- oob = malloc(6);
+ u8 oob[6];
if ((first < 0) || (first >= device->num_blocks))
first = 0;