diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 1d0e43f4ac4..2f4a88eb0f8 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -837,6 +837,9 @@ reprotect_and_return_err: bool old_format, uint64_t features, int *order, uint64_t stripe_unit, uint64_t stripe_count) { + if (!order) + return -EINVAL; + CephContext *cct = (CephContext *)io_ctx.cct(); ldout(cct, 20) << "create " << &io_ctx << " name = " << imgname << " size = " << size << " old_format = " << old_format @@ -862,9 +865,6 @@ reprotect_and_return_err: return -EEXIST; } - if (!order) - return -EINVAL; - if (!*order) *order = cct->_conf->rbd_default_order; if (!*order)