X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fiface-code-inject.c;h=1262d772d1db80139dcdb43305efc0a708d2ec95;hb=da0b4bb80de755529f47b9ca57ccb0c2cefae15b;hp=b36edd19f4156401e9d8bcbb1882dfe32445dd66;hpb=07aa8f3c18a33af0961e7546980a63ab5f6fba4f;p=palacios.git diff --git a/linux_module/iface-code-inject.c b/linux_module/iface-code-inject.c index b36edd1..1262d77 100644 --- a/linux_module/iface-code-inject.c +++ b/linux_module/iface-code-inject.c @@ -7,7 +7,6 @@ #include #include -#include #include @@ -56,7 +55,7 @@ static int vm_tophalf_inject (struct v3_guest * guest, unsigned int cmd, unsigne struct top_half_data * top; top = palacios_alloc(sizeof(struct top_half_data)); - if (IS_ERR(top)) { + if (!top) { ERROR("Palacios Error: could not allocate space for top half data\n"); return -EFAULT; } @@ -82,7 +81,7 @@ static int vm_tophalf_inject (struct v3_guest * guest, unsigned int cmd, unsigne DEBUG("Palacios: Allocating %lu B of kernel memory for ELF binary data...\n", top->elf_size); top->elf_data = palacios_alloc(top->elf_size); - if (IS_ERR(top->elf_data)) { + if (!(top->elf_data)) { ERROR("Palacios Error: could not allocate space for binary image\n"); palacios_free(top); return -EFAULT; @@ -136,6 +135,7 @@ static int guest_init_code_inject (struct v3_guest * guest, void ** vm_data) { static int guest_deinit_code_inject (struct v3_guest * guest, void * vm_data) { free_inject_data(); + remove_guest_ctrl(guest, V3_VM_TOPHALF_INJECT); return 0; }