Better just do this:

g_mk = new MK(3, device_path);
if (!g_mk) {
  return ERRORCODE?;
}