mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-22 12:14:01 +08:00
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>
This commit is contained in:
parent
02851e9f00
commit
2265b473ae
@ -3020,6 +3020,8 @@ void drbd_mdev_cleanup(struct drbd_conf *mdev)
|
||||
D_ASSERT(list_empty(&mdev->resync_work.list));
|
||||
D_ASSERT(list_empty(&mdev->unplug_work.list));
|
||||
D_ASSERT(list_empty(&mdev->go_diskless.list));
|
||||
|
||||
drbd_set_defaults(mdev);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user