[libvirt PATCH 1/2] hostdev: Update mdev pointer reference after checking device type

Ján Tomko jtomko at redhat.com
Thu Jan 7 20:23:51 UTC 2021


On a Thursday in 2021, Erik Skultety wrote:
>We set the pointer to some garbage packed structure data without
>knowing whether it actually we were handling the type of device we
>expected to be handling. On its own, this was harmless, because we'd
>never use the pointer as we'd skip the device if it were not the
>expected type. However, it's better to make the logic even more
>explicit - we first check the device and only when we're sure we have
>the expected type we then update the pointer shortcut.
>
>Signed-off-by: Erik Skultety <eskultet at redhat.com>
>---
> src/hypervisor/virhostdev.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210107/2b3acc60/attachment-0001.sig>


More information about the libvir-list mailing list