Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f0dccf8 authored by Vitaly Kuznetsov's avatar Vitaly Kuznetsov Committed by Greg Kroah-Hartman
Browse files

Drivers: hv: fcopy: set .owner reference for file operations



Get an additional reference otherwise a crash is observed when hv_utils module is being unloaded while
fcopy daemon is still running. .owner gives us an additional reference when
someone holds a descriptor for the device.

Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
Tested-by: default avatarAlex Ng <alexng@microsoft.com>
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4c93cccc
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -360,12 +360,9 @@ static int fcopy_open(struct inode *inode, struct file *f)
}

/* XXX: there are still some tricky corner cases, e.g.,
 * 1) In a SMP guest, when fcopy_release() runs between
 * In an SMP guest, when fcopy_release() runs between
 * schedule_delayed_work() and fcopy_send_data(), there is
 * still a chance an obsolete message will be queued.
 *
 * 2) When the fcopy daemon is running, if we unload the driver,
 * we'll notice a kernel oops when we kill the daemon later.
 */
static int fcopy_release(struct inode *inode, struct file *f)
{
@@ -385,6 +382,7 @@ static int fcopy_release(struct inode *inode, struct file *f)


static const struct file_operations fcopy_fops = {
	.owner          = THIS_MODULE,
	.read           = fcopy_read,
	.write          = fcopy_write,
	.release	= fcopy_release,