libgralloc: Fix possible leak of fd
Fix possible leak of fd in ion allocation. If mmap fails close the fd before returning. Change-Id: Id414792c14a75259f6075b0d76bc470c31fb5853 CRs-fixed: 387633
This commit is contained in:
parent
36445e454b
commit
e09a5d04db
@ -126,6 +126,8 @@ int IonAlloc::alloc_buffer(alloc_data& data)
|
||||
ALOGE("%s: Failed to map the allocated memory: %s",
|
||||
__FUNCTION__, strerror(errno));
|
||||
ioctl(mIonFd, ION_IOC_FREE, &handle_data);
|
||||
if(ionSyncFd >= 0)
|
||||
close(ionSyncFd);
|
||||
ionSyncFd = FD_INIT;
|
||||
return err;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user