Skip to content

Commit

Permalink
mm-video: Add NULL check for argument to IOCTL call.
Browse files Browse the repository at this point in the history
Add NULL check for the argument being passed to
IOCTL call.

CRs-Fixed: 2234845

Change-Id: Ica7bcc57c035e082575926e7e130b29b38bb4681
  • Loading branch information
Dikshita Agarwal authored and Gerrit - the friendly Code Review server committed Sep 10, 2018
1 parent d809db3 commit 3033455
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions mm-video-v4l2/vidc/vdec/src/omx_swvdec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4900,11 +4900,18 @@ void omx_swvdec::ion_flush_op(unsigned int index)
flush_data.vaddr,
flush_data.length);

rc = ioctl(fd, ION_IOC_CUSTOM, &custom_data);

if (rc < 0)
if(flush_data.fd && flush_data.vaddr)
{
OMX_SWVDEC_LOG_ERROR("ioctl() for clean cache failed");
rc = ioctl(fd, ION_IOC_CUSTOM, &custom_data);
if (rc < 0)
{
OMX_SWVDEC_LOG_ERROR("ioctl() for clean cache failed"
"handle %d, fd %d, vaddr %p, length %d",
flush_data.handle,
flush_data.fd,
flush_data.vaddr,
flush_data.length);
}
}

close(fd);
Expand Down

0 comments on commit 3033455

Please sign in to comment.