Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89ea2811 authored by Sandeep Patil's avatar Sandeep Patil
Browse files

libion: Add missing error checks for input parameters to APIs.



The errors were caught by ion-unit-tests. Make sure we fix them before
we start running the tests in automation etc.

Bug: 133508579
Test: ion-unit-tests

Change-Id: I7ebecfa037767481ee7f2b30e2923c84ebc352bf
Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
parent 21620dc7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -152,6 +152,8 @@ int ion_alloc_fd(int fd, size_t len, size_t align, unsigned int heap_mask, unsig
    ion_user_handle_t handle;
    int ret;

    if (!handle_fd) return -EINVAL;

    if (!ion_is_legacy(fd)) {
        struct ion_new_allocation_data data = {
            .len = len,
@@ -201,6 +203,7 @@ int ion_query_heap_cnt(int fd, int* cnt) {
    int ret;
    struct ion_heap_query query;

    if (!cnt) return -EINVAL;
    memset(&query, 0, sizeof(query));

    ret = ion_ioctl(fd, ION_IOC_HEAP_QUERY, &query);