]> git.baikalelectronics.ru Git - kernel.git/commit
xen/xenbus: reference count registered modules
authorPaul Durrant <pdurrant@amazon.com>
Mon, 2 Dec 2019 11:41:16 +0000 (11:41 +0000)
committerJuergen Gross <jgross@suse.com>
Wed, 4 Dec 2019 10:35:32 +0000 (11:35 +0100)
commit58547c1f025386eaeb5e9feee7874813a70314e2
treeaa6b4957093d5db5daef3581963436ed7be1b748
parent76b7f00e7f29b0391b675bff0c13062041a32c96
xen/xenbus: reference count registered modules

To prevent a PV driver module being removed whilst attached to its other
end, and hence xenbus calling into potentially invalid text, take a
reference on the module before calling the probe() method (dropping it if
unsuccessful) and drop the reference after returning from the remove()
method.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/xen/xenbus/xenbus_probe.c