resource: Fix missing NULL check 39/281339/1
authorDongwoo Lee <dwoo08.lee@samsung.com>
Thu, 15 Sep 2022 10:51:18 +0000 (19:51 +0900)
committerDongwoo Lee <dwoo08.lee@samsung.com>
Thu, 15 Sep 2022 10:51:18 +0000 (19:51 +0900)
Change-Id: I8a9f2d5139ad6298788d373485d24110e9d85979
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
src/util/resource.c

index 2def817..39ccc68 100644 (file)
@@ -233,6 +233,9 @@ int create_resource(struct resource **res, int resource_type)
        struct resource *resource = NULL;
        int i, ret;
 
+       if (!res)
+               return -EINVAL;
+
        driver = find_resource_driver(resource_type);
        if (!driver) {
                _E("failed to find resource driver, res:type(%d)\n",