Skip to main content

omapdss_of_find_source_for_first_ep

API Overview

omapdss_of_find_source_for_first_ep is an API in Linux kernel. This rule belongs to the return value check type. This rule is generated using APISpecGen.

Rule Description

tip

omapdss_of_find_source_for_first_ep returns error pointer on failure, use IS_ERR to check the return value

info
  • Tags: return value check
  • Parameter Index: N/A
  • CWE Type: CWE-253

Rule Code


import cpp
import semmle.code.cpp.controlflow.SSA


class EVPFunctionCall extends FunctionCall {
EVPFunctionCall() {
this.getTarget().hasName("omapdss_of_find_source_for_first_ep")
}
}


predicate isErrCheckFunction(Function f) {
f.hasName("IS_ERR")
}

from EVPFunctionCall call, ValueAccess ret
where
ret = call.getAnAccess() and
not exists(FunctionCall check |
isErrCheckFunction(check.getTarget()) and
check.getArgument(0).getAChild*() = ret
)
select call, "The return value of omapdss_of_find_source_for_first_ep is not checked with IS_ERR."