Changeset a0bf44e in rtems for cpukit/dev/i2c


Ignore:
Timestamp:
Nov 24, 2014, 8:06:49 PM (5 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
4afa216
Parents:
0a0ded70
git-author:
Joel Sherrill <joel.sherrill@…> (11/24/14 20:06:49)
git-committer:
Joel Sherrill <joel.sherrill@…> (11/25/14 18:57:08)
Message:

cpukit/dev/i2c/i2c-dev.c: Fix leak on error path

Coverity ID 1255520. fd was not closed on error path.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/dev/i2c/i2c-dev.c

    r0a0ded70 ra0bf44e  
    225225  if (fd < 0) {
    226226    (*destroy)(dev);
    227 
    228227    return -1;
    229228  }
     
    231230  rv = ioctl(fd, I2C_BUS_GET_CONTROL, &dev->bus);
    232231  if (rv != 0) {
     232    (void) close(fd);
    233233    (*destroy)(dev);
    234 
    235234    return -1;
    236235  }
Note: See TracChangeset for help on using the changeset viewer.