Revision 2d6c1ef4 hw/qdev-properties.c

b/hw/qdev-properties.c
351 351
    CharDriverState **ptr = qdev_get_prop_ptr(dev, prop);
352 352

  
353 353
    *ptr = qemu_chr_find(str);
354
    if (*ptr == NULL)
354
    if (*ptr == NULL) {
355 355
        return -ENOENT;
356
    }
357
    if ((*ptr)->assigned) {
358
        return -EEXIST;
359
    }
360
    (*ptr)->assigned = 1;
356 361
    return 0;
357 362
}
358 363

  

Also available in: Unified diff