mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 20:54:10 +08:00
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: Shaobo <shaobo@cs.utah.edu> Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
183ece3005
commit
d3d2948f43
@ -1756,6 +1756,11 @@ void drbd_start_resync(struct drbd_device *device, enum drbd_conns side)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!connection) {
|
||||
drbd_err(device, "No connection to peer, aborting!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!test_bit(B_RS_H_DONE, &device->flags)) {
|
||||
if (side == C_SYNC_TARGET) {
|
||||
/* Since application IO was locked out during C_WF_BITMAP_T and
|
||||
|
Loading…
Reference in New Issue
Block a user