提交 dc88db7e 编写于 作者: J Joerg Roedel

iommu/amd: Drop pasid_state reference in ppr_notifer error path

In case we are not able to allocate a fault structure a
reference to the pasid_state will be leaked. Fix that by
dropping the reference in the error path in case we hold
one.
Signed-off-by: NJoerg Roedel <jroedel@suse.de>
Tested-by: NOded Gabbay <Oded.Gabbay@amd.com>
上级 61feb438
...@@ -607,6 +607,10 @@ static int ppr_notifier(struct notifier_block *nb, unsigned long e, void *data) ...@@ -607,6 +607,10 @@ static int ppr_notifier(struct notifier_block *nb, unsigned long e, void *data)
ret = NOTIFY_OK; ret = NOTIFY_OK;
out_drop_state: out_drop_state:
if (ret != NOTIFY_OK && pasid_state)
put_pasid_state(pasid_state);
put_device_state(dev_state); put_device_state(dev_state);
out: out:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册