diff options
author | Alexander Shishkin <alexander.shishkin@linux.intel.com> | 2016-04-08 10:36:04 -0400 |
---|---|---|
committer | Alexander Shishkin <alexander.shishkin@linux.intel.com> | 2016-04-08 10:43:34 -0400 |
commit | 8e9a2beb5f991916e530184957c4137fab14604c (patch) | |
tree | e07d9f0617bf95741aa7dd131164eb9f2295d44e /drivers/hwtracing/intel_th | |
parent | e2ea295baf87d78f2ed86ce595b30c691b18b210 (diff) |
intel_th: msu: Set fops::owner to prevent module from unloading
Right now it's possible to unload the msu driver while its character
device is open. Prevent it by setting fops::owner, which will result
in the module reference being held while the device node is open.
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Laurent Fert <laurent.fert@intel.com>
Diffstat (limited to 'drivers/hwtracing/intel_th')
-rw-r--r-- | drivers/hwtracing/intel_th/msu.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/msu.c index ee153067e136..bcc3b4713377 100644 --- a/drivers/hwtracing/intel_th/msu.c +++ b/drivers/hwtracing/intel_th/msu.c | |||
@@ -1253,6 +1253,7 @@ static const struct file_operations intel_th_msc_fops = { | |||
1253 | .read = intel_th_msc_read, | 1253 | .read = intel_th_msc_read, |
1254 | .mmap = intel_th_msc_mmap, | 1254 | .mmap = intel_th_msc_mmap, |
1255 | .llseek = no_llseek, | 1255 | .llseek = no_llseek, |
1256 | .owner = THIS_MODULE, | ||
1256 | }; | 1257 | }; |
1257 | 1258 | ||
1258 | static int intel_th_msc_init(struct msc *msc) | 1259 | static int intel_th_msc_init(struct msc *msc) |