X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fgeneric.c;h=bf4adc4c418d8faaaa84a802caa0b42fe60fa492;hb=60ad6a41c6d0ee08ed689e8505eb0c3df0c2a289;hp=ba2965f6d9fb27e9afc0ef0120a31536978cacdb;hpb=ff0fec756f4800fe869f3dff2f164d3ffcfc83e6;p=palacios.git diff --git a/palacios/src/devices/generic.c b/palacios/src/devices/generic.c index ba2965f..bf4adc4 100644 --- a/palacios/src/devices/generic.c +++ b/palacios/src/devices/generic.c @@ -749,6 +749,10 @@ static int generic_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { uint16_t start = atox(v3_cfg_val(port_cfg, "start")); uint16_t end = atox(v3_cfg_val(port_cfg, "end")); char * mode_str = v3_cfg_val(port_cfg, "mode"); + if (!mode_str) { + PrintError(vm, VCORE_NONE, "generic (%s): error getting port mode\n", state->name); + return -1; + } generic_mode_t mode = GENERIC_IGNORE; if (strcasecmp(mode_str, "print_and_ignore") == 0) { mode = GENERIC_PRINT_AND_IGNORE;