Commit ceefb463 authored by Marcin Spiewak's avatar Marcin Spiewak Committed by Jim Harris
Browse files

lvol: Fixed potential NULL pointer dereference



Fixed issue found by Klocwork - potential NULL
pointer dereference

Change-Id: I2984942e7dd675c0f2663182331b3c30ea4f9322
Signed-off-by: default avatarMarcin Spiewak <marcin.spiewak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17951


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 8a748d54
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1554,7 +1554,7 @@ spdk_lvol_destroy(struct spdk_lvol *lvol, spdk_lvol_op_complete cb_fn, void *cb_
{
	struct spdk_lvol_req *req;
	struct spdk_blob_store *bs;
	struct spdk_lvol_store	*lvs = lvol->lvol_store;
	struct spdk_lvol_store	*lvs;
	spdk_blob_id	clone_id;
	size_t		count = 1;
	int		rc;
@@ -1567,6 +1567,8 @@ spdk_lvol_destroy(struct spdk_lvol *lvol, spdk_lvol_op_complete cb_fn, void *cb_
		return;
	}

	lvs = lvol->lvol_store;

	if (lvol->ref_count != 0) {
		SPDK_ERRLOG("Cannot destroy lvol %s because it is still open\n", lvol->unique_id);
		cb_fn(cb_arg, -EBUSY);