Skip to content
Snippets Groups Projects
Commit d3d2948f authored by Roland Kammerer's avatar Roland Kammerer Committed by Jens Axboe
Browse files

drbd: abort drbd_start_resync if there is no connection


This was found by a static analysis tool. While highly unlikely, be sure
to return without dereferencing the NULL pointer.

Reported-by: default avatarShaobo <shaobo@cs.utah.edu>
Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 183ece30
No related branches found
No related tags found
No related merge requests found
...@@ -1756,6 +1756,11 @@ void drbd_start_resync(struct drbd_device *device, enum drbd_conns side) ...@@ -1756,6 +1756,11 @@ void drbd_start_resync(struct drbd_device *device, enum drbd_conns side)
return; return;
} }
if (!connection) {
drbd_err(device, "No connection to peer, aborting!\n");
return;
}
if (!test_bit(B_RS_H_DONE, &device->flags)) { if (!test_bit(B_RS_H_DONE, &device->flags)) {
if (side == C_SYNC_TARGET) { if (side == C_SYNC_TARGET) {
/* Since application IO was locked out during C_WF_BITMAP_T and /* Since application IO was locked out during C_WF_BITMAP_T and
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment