pass: rescon: Fix missing NULL check 12/270012/1
authorDongwoo Lee <dwoo08.lee@samsung.com>
Mon, 24 Jan 2022 06:46:33 +0000 (15:46 +0900)
committerDongwoo Lee <dwoo08.lee@samsung.com>
Mon, 24 Jan 2022 06:48:13 +0000 (15:48 +0900)
Change-Id: I374f3d608b055ea589d9ed1dbb4ca43d890a3fa3
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
src/pass/pass-rescon.c

index cf74d3ff4d8bee74f8b2e18b16dd432ce001dcd9..c06c00d23d099aeefc4e86c03cf6e837861e80a7 100644 (file)
@@ -540,6 +540,9 @@ int pass_rescon_set_overridable(struct pass_resource *res, int overridable)
 int pass_rescon_set_scenario_level_sync_with_data(struct pass_resource *res,
                                        int scenario_level, void *data)
 {
+       if (!res)
+               return -EINVAL;
+
        /*
         * FIXME: PMQoS core sends the raw data to the HAL in order to
         * support the backwards compatibility. This function call will
@@ -564,6 +567,9 @@ int pass_rescon_set_scenario_level_sync_with_data(struct pass_resource *res,
 int pass_rescon_unset_scenario_level_sync_with_data(struct pass_resource *res,
                                        int scenario_level, void *data)
 {
+       if (!res)
+               return -EINVAL;
+
        /*
         * FIXME: PMQoS core sends the raw data to the HAL in order to
         * support the backwards compatibility. This function call will