Changeset 29e7a069 in rtems


Ignore:
Timestamp:
Aug 1, 2020, 12:30:10 PM (6 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
6014fad
Parents:
c60942ea
git-author:
Sebastian Huber <sebastian.huber@…> (08/01/20 12:30:10)
git-committer:
Sebastian Huber <sebastian.huber@…> (08/03/20 06:53:31)
Message:

dev/spi-memdrv: Fix use of uninit mem_param_ptr

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bsps/shared/dev/i2c/spi-memdrv.c

    rc60942ea r29e7a069  
    366366  }
    367367
    368   if (off >= mem_param_ptr->mem_size) {
     368  if (rc == RTEMS_SUCCESSFUL) {
    369369    /*
    370370     * HACK: beyond size of memory array? then read status register instead
    371371     */
    372     /*
    373      * send read status register command
    374      */
    375     if (rc == RTEMS_SUCCESSFUL) {
     372    if (off >= mem_param_ptr->mem_size) {
     373      /*
     374       * send read status register command
     375       */
    376376      cmdbuf[0] = SPI_MEM_CMD_RDSR;
    377377      ret_cnt = rtems_libi2c_write_bytes(minor,cmdbuf,1);
     
    379379        rc = -ret_cnt;
    380380      }
    381     }
    382   }
    383   else {
    384     /*
    385      * send read command and address
    386      */
    387     if (rc == RTEMS_SUCCESSFUL) {
     381    } else {
     382      /*
     383       * send read command and address
     384       */
    388385      cmdbuf[0] = SPI_MEM_CMD_READ;
    389386      if (mem_param_ptr->mem_size > 0x10000 /* 256*256 */) {
Note: See TracChangeset for help on using the changeset viewer.