Showing error 1821

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: drivers/mtd/devices/m25p80.c
Line in file: 349
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-11 08:47:26 UTC


Source:

319        t[1].rx_buf = buf;
320        t[1].len = len;
321        spi_message_add_tail(&t[1], &m);
322
323        /* Byte count starts at zero. */
324        if (retlen)
325                *retlen = 0;
326
327        mutex_lock(&flash->lock);
328
329        /* Wait till previous write/erase is done. */
330        if (wait_till_ready(flash)) {
331                /* REVISIT status return?? */
332                mutex_unlock(&flash->lock);
333                return 1;
334        }
335
336        /* FIXME switch to OPCODE_FAST_READ.  It's required for higher
337         * clocks; and at this writing, every chip this driver handles
338         * supports that opcode.
339         */
340
341        /* Set up the write data buffer. */
342        flash->command[0] = OPCODE_READ;
343        flash->command[1] = from >> 16;
344        flash->command[2] = from >> 8;
345        flash->command[3] = from;
346
347        spi_sync(flash->spi, &m);
348
349        *retlen = m.actual_length - CMD_SIZE - FAST_READ_DUMMY_BYTE;
350
351        mutex_unlock(&flash->lock);
352
353        return 0;
354}
355
356/*
357 * Write an address range to the flash chip.  Data must be written in
358 * FLASH_PAGESIZE chunks.  The address range may be any size provided
359 * it is within the physical boundaries.
Show full sources