md_type is an enum. On my tests, GCC treats it as unsigned but
according to the C standard it's an implementation dependant thing so we
should check for negatives.
Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
return 0;
md_type = md->type;
- if (md_type >= ATOMISP_METADATA_TYPE_NUM)
+ if (md_type < 0 || md_type >= ATOMISP_METADATA_TYPE_NUM)
return -EINVAL;
/* This is done in the atomisp_buf_done() */