Some temporary buffers are allocated with "sizeof(pointer) * count" as
size argument, which cannot possibly be correct.
Assuming what was meant was "sizeof(pointer[0]) * count" makes sense
in the context of how the buffers are used, but is actually pretty
pointless, since the buffers are unsigend char.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
return errmsg("mtd_get_dev_info failed");
/* Allocate buffers */
- oobbuf = xmalloc(sizeof(oobbuf) * mtd.oob_size);
- readbuf = xmalloc(sizeof(readbuf) * mtd.min_io_size);
+ oobbuf = xmalloc(mtd.oob_size);
+ readbuf = xmalloc(mtd.min_io_size);
if (noecc) {
if (ioctl(fd, MTDFILEMODE, MTD_FILE_MODE_RAW) != 0) {