if (!get_ldev_if_state(mdev, D_ATTACHING)) { /* put is in bm_aio_ctx_destroy() */
dev_err(DEV, "ASSERT FAILED: get_ldev_if_state() == 1 in bm_rw()\n");
- err = -ENODEV;
- goto out;
+ kfree(ctx);
+ return -ENODEV;
}
if (!ctx->flags)
dev_info(DEV, "%s (%lu bits) marked out-of-sync by on disk bit-map.\n",
ppsize(ppb, now << (BM_BLOCK_SHIFT-10)), now);
-out:
kref_put(&ctx->kref, &bm_aio_ctx_destroy);
return err;
}
if (!get_ldev_if_state(mdev, D_ATTACHING)) { /* put is in bm_aio_ctx_destroy() */
dev_err(DEV, "ASSERT FAILED: get_ldev_if_state() == 1 in drbd_bm_write_page()\n");
- err = -ENODEV;
- goto out;
+ kfree(ctx);
+ return -ENODEV;
}
bm_page_io_async(ctx, idx, WRITE_SYNC);
mdev->bm_writ_cnt++;
err = atomic_read(&ctx->in_flight) ? -EIO : ctx->error;
- out:
kref_put(&ctx->kref, &bm_aio_ctx_destroy);
return err;
}