diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2010-12-16 09:41:26 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-10 05:43:30 -0500 |
commit | 2265b473aecc1a6fe1f84a0ee272ba39806c2a8a (patch) | |
tree | bd58a09ad124dd37f15db23f20912049ccd067cd /drivers/block/drbd | |
parent | 02851e9f00d78dbc8ded0aacbf9bf3b631d627b3 (diff) |
drbd: fix potential dereference of NULL pointer
If drbd used to have crypto digest algorithms configured, then is being
unconfigured (but not unloaded), it frees the algorithms, but does not
reset the config. If it then is reconfigured to use the very same
algorithm, it "forgot" to re-allocate the algorithms, thinking that the
config has not changed in that aspect.
It will then Oops on the first attempt to actually use those algorithms.
Fix this by resetting the config to defaults after cleanup.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd')
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index c6c7e3e6dc23..4da6f11cc82e 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -3020,6 +3020,8 @@ void drbd_mdev_cleanup(struct drbd_conf *mdev) | |||
3020 | D_ASSERT(list_empty(&mdev->resync_work.list)); | 3020 | D_ASSERT(list_empty(&mdev->resync_work.list)); |
3021 | D_ASSERT(list_empty(&mdev->unplug_work.list)); | 3021 | D_ASSERT(list_empty(&mdev->unplug_work.list)); |
3022 | D_ASSERT(list_empty(&mdev->go_diskless.list)); | 3022 | D_ASSERT(list_empty(&mdev->go_diskless.list)); |
3023 | |||
3024 | drbd_set_defaults(mdev); | ||
3023 | } | 3025 | } |
3024 | 3026 | ||
3025 | 3027 | ||