Skip to contentSkip to conversation

kvm/kvm_main: The ops pointer variable does not need to be initialized and assigned, it is first allocated a memory address

PATCH New Li kunyu 1 participant 1 message Aug 12, 2022 KVM

lore
Share & tools
lore

Li kunyu

author
#0 lore raw

PATCH 3/5 kvm/kvm_main: The ops pointer variable does not need to be initialized and assigned, it is first allocated a memory address

The ops pointer variable does not need to be initialized, because it first allocates a memory address before it is used.

---
 virt/kvm/kvm_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
virt/kvm/kvm_main.c +1 -1
index 80f7934c1f59..82f2b90718a9 100644
@@ -4378,7 +4378,7 @@ void kvm_unregister_device_ops(u32 type)
 static int kvm_ioctl_create_device(struct kvm *kvm,
 				   struct kvm_create_device *cd)
 {
-	const struct kvm_device_ops *ops = NULL;
+	const struct kvm_device_ops *ops;
 	struct kvm_device *dev;
 	bool test = cd->flags & KVM_CREATE_DEVICE_TEST;
 	int type;
Signature · 1 line
2.18.2