diff options
author | Rakesh Pandit <rakesh@tuxera.com> | 2017-10-13 14:45:50 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-10-13 16:34:57 +0200 |
commit | 900148296b78c61aa8c443dc594c0da968c3be53 (patch) | |
tree | 916dfc2000208ddb8cc5e829ddef190cf9049cff /drivers/lightnvm/pblk-init.c | |
parent | mtip32xx: Clean up unused variables (diff) | |
download | linux-900148296b78c61aa8c443dc594c0da968c3be53.tar.xz linux-900148296b78c61aa8c443dc594c0da968c3be53.zip |
lightnvm: prevent target type module removal when in use
If target type module e.g. pblk here is unloaded (rmmod) while module
is in use (after creating target) system crashes. We fix this by
using module API refcnt.
Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/lightnvm/pblk-init.c')
-rw-r--r-- | drivers/lightnvm/pblk-init.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c index 1b0f61233c21..6df65d14a2c5 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c @@ -1044,6 +1044,7 @@ static struct nvm_tgt_type tt_pblk = { .sysfs_init = pblk_sysfs_init, .sysfs_exit = pblk_sysfs_exit, + .owner = THIS_MODULE, }; static int __init pblk_module_init(void) |