From: Naveen Kumar Parna Date: Tue, 22 Jan 2019 13:44:02 +0000 (+0530) Subject: mbcs: add .owner to mbcs struct file_operations X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f9f7bb9e0a0ca33f65a3deae9ec5e07266908fc5;p=openwrt%2Fstaging%2Fblogic.git mbcs: add .owner to mbcs struct file_operations Without ".owner = THIS_MODULE" it is possible to crash the kernel by unloading the mbcs module while someone works with the file. Fix this by initializing the ‘struct file_operations' ->owner with THIS_MODULE. Signed-off-by: Naveen Kumar Parna Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c index 8c9216a0f62e..0a31b60bee7b 100644 --- a/drivers/char/mbcs.c +++ b/drivers/char/mbcs.c @@ -50,6 +50,7 @@ static LIST_HEAD(soft_list); * file operations */ static const struct file_operations mbcs_ops = { + .owner = THIS_MODULE, .open = mbcs_open, .llseek = mbcs_sram_llseek, .read = mbcs_sram_read,