unset_resource_attr_interest function is able to unset
the resource interest state when resource interest were already
interested. If wrong interest_mask is used, should return fail.
So that Check whether interest_mask is valid or not
before unsetting resource attribute interest.
Change-Id: I047a30ab1fa5c0cafd23327a7fbfabc9c3c9b274
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
if (!resource)
return -EINVAL;
+ if (!is_resource_attr_interested(resource, interest_mask))
+ return -EINVAL;
+
for (i = 0; i < resource->num_attrs; i++) {
if (!(resource->attrs[i].id & interest_mask))
continue;