* [PATCH] xenbus: remove transaction holder from list before freeing
@ 2017-04-04 12:27 Jan Beulich
0 siblings, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2017-04-04 12:27 UTC (permalink / raw)
To: Boris Ostrovsky, Juergen Gross; +Cc: xen-devel
After allocation the item is being placed on the list right away.
Consequently it needs to be taken off the list before freeing in the
case xenbus_dev_request_and_reply() failed, as in that case the
callback (xenbus_dev_queue_reply()) is not being called (and if it
was called, it should do both).
Fixes: 5584ea250ae44f929feb4c7bd3877d1c5edbf813
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
drivers/xen/xenbus/xenbus_dev_frontend.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- 4.11-rc5/drivers/xen/xenbus/xenbus_dev_frontend.c
+++ 4.11-rc5-xenbus-del-trans/drivers/xen/xenbus/xenbus_dev_frontend.c
@@ -442,8 +442,10 @@ static int xenbus_write_transaction(unsi
return xenbus_command_reply(u, XS_ERROR, "ENOENT");
rc = xenbus_dev_request_and_reply(&u->u.msg, u);
- if (rc)
+ if (rc && trans) {
+ list_del(&trans->list);
kfree(trans);
+ }
out:
return rc;
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xenbus: remove transaction holder from list before freeing
2017-04-04 13:42 ` Juergen Gross
@ 2017-04-04 17:02 ` Boris Ostrovsky
0 siblings, 0 replies; 3+ messages in thread
From: Boris Ostrovsky @ 2017-04-04 17:02 UTC (permalink / raw)
To: Juergen Gross, Jan Beulich; +Cc: xen-devel
On 04/04/2017 09:42 AM, Juergen Gross wrote:
> On 04/04/17 14:27, Jan Beulich wrote:
>> After allocation the item is being placed on the list right away.
>> Consequently it needs to be taken off the list before freeing in the
>> case xenbus_dev_request_and_reply() failed, as in that case the
>> callback (xenbus_dev_queue_reply()) is not being called (and if it
>> was called, it should do both).
>>
>> Fixes: 5584ea250ae44f929feb4c7bd3877d1c5edbf813
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Reviewed-by: Juergen Gross <jgross@suse.com>
Applied to for-linus-4.11b.
-boris
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xenbus: remove transaction holder from list before freeing
[not found] <58E3AD4A020000780014C9C9@suse.com>
@ 2017-04-04 13:42 ` Juergen Gross
2017-04-04 17:02 ` Boris Ostrovsky
0 siblings, 1 reply; 3+ messages in thread
From: Juergen Gross @ 2017-04-04 13:42 UTC (permalink / raw)
To: Jan Beulich, Boris Ostrovsky; +Cc: xen-devel
On 04/04/17 14:27, Jan Beulich wrote:
> After allocation the item is being placed on the list right away.
> Consequently it needs to be taken off the list before freeing in the
> case xenbus_dev_request_and_reply() failed, as in that case the
> callback (xenbus_dev_queue_reply()) is not being called (and if it
> was called, it should do both).
>
> Fixes: 5584ea250ae44f929feb4c7bd3877d1c5edbf813
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Thanks,
Juergen
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-04-04 17:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-04 12:27 [PATCH] xenbus: remove transaction holder from list before freeing Jan Beulich
[not found] <58E3AD4A020000780014C9C9@suse.com>
2017-04-04 13:42 ` Juergen Gross
2017-04-04 17:02 ` Boris Ostrovsky
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.