mirror of https://github.com/proxmox/mirror_qemu
Warn if value of qdev_init() isn't checked
After qdev_init() fails, the device is gone. Failure to check runs a high risk of use-after-free. Patchworks-ID: 35166 Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>master
parent
3f66aa9c07
commit
dde8bbb44d
|
@ -100,7 +100,7 @@ struct CompatProperty {
|
|||
|
||||
DeviceState *qdev_create(BusState *bus, const char *name);
|
||||
DeviceState *qdev_device_add(QemuOpts *opts);
|
||||
int qdev_init(DeviceState *dev);
|
||||
int qdev_init(DeviceState *dev) __attribute__((warn_unused_result));
|
||||
void qdev_init_nofail(DeviceState *dev);
|
||||
int qdev_unplug(DeviceState *dev);
|
||||
void qdev_free(DeviceState *dev);
|
||||
|
|
Loading…
Reference in New Issue