hostdev: Update mdev pointer reference after checking device type
hostdev: Update mdev pointer reference after checking device type

We set the pointer to some garbage packed structure data without
knowing whether we were actually 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 <2c14d38fa47c8799f1b9c16280abe27f8edfec6e@redhat.com>
Reviewed-by: Ján Tomko <4cab11cfb98d3c937327354a78eb07dbb6ee2bc6@redhat.com>

jfehlig/libvirt,libvirt/libvirt,crobinso/libvirt,olafhering/libvirt,jfehlig/libvirt,zippy2/libvirt,zippy2/libvirt,nertpinx/libvirt,nertpinx/libvirt,nertpinx/libvirt,nertpinx/libvirt,olafhering/libvirt,zippy2/libvirt,jfehlig/libvirt,zippy2/libvirt,libvirt/libvirt,jfehlig/libvirt,libvirt/libvirt,crobinso/libvirt,crobinso/libvirt,nertpinx/libvirt,crobinso/libvirt,libvirt/libvirt,olafhering/libvirt,olafhering/libvirt