瀏覽代碼

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>
Alexander Shishkin 9 年之前
父節點
當前提交
8e9a2beb5f
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/hwtracing/intel_th/msu.c

+ 1 - 0
drivers/hwtracing/intel_th/msu.c

@@ -1253,6 +1253,7 @@ static const struct file_operations intel_th_msc_fops = {
 	.read		= intel_th_msc_read,
 	.mmap		= intel_th_msc_mmap,
 	.llseek		= no_llseek,
+	.owner		= THIS_MODULE,
 };
 
 static int intel_th_msc_init(struct msc *msc)