Unverified Commit 026ce400 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!10190 Drivers: hv: vmbus: Fix memory leak in vmbus_add_channel_kobj

parents 8cfcf54d ed8706e2
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -1468,8 +1468,10 @@ int vmbus_add_channel_kobj(struct hv_device *dev, struct vmbus_channel *channel)
	kobj->kset = dev->channels_kset;
	kobj->kset = dev->channels_kset;
	ret = kobject_init_and_add(kobj, &vmbus_chan_ktype, NULL,
	ret = kobject_init_and_add(kobj, &vmbus_chan_ktype, NULL,
				   "%u", relid);
				   "%u", relid);
	if (ret)
	if (ret) {
		kobject_put(kobj);
		return ret;
		return ret;
	}


	kobject_uevent(kobj, KOBJ_ADD);
	kobject_uevent(kobj, KOBJ_ADD);