diff options
author | Vitaly Kuznetsov <vkuznets@redhat.com> | 2015-04-11 18:07:50 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-24 12:17:41 -0700 |
commit | 3f0dccf86cab38d96b67efdfc944954f5490d057 (patch) | |
tree | 9316e36f19dc55631308b3dc04cc869ad8ac3a90 /drivers/hv | |
parent | 4c93ccccf47e32d605b81207eb575cce3b12facc (diff) | |
download | talos-obmc-linux-3f0dccf86cab38d96b67efdfc944954f5490d057.tar.gz talos-obmc-linux-3f0dccf86cab38d96b67efdfc944954f5490d057.zip |
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: Vitaly Kuznetsov <vkuznets@redhat.com>
Tested-by: Alex Ng <alexng@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv')
-rw-r--r-- | drivers/hv/hv_fcopy.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/hv/hv_fcopy.c b/drivers/hv/hv_fcopy.c index a501301e5b88..d1475e6aa9ac 100644 --- a/drivers/hv/hv_fcopy.c +++ b/drivers/hv/hv_fcopy.c @@ -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, |