flat: use IS_ERR_VALUE() helper macro