Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 584217b7 authored by Arun Kumar Golakaram's avatar Arun Kumar Golakaram Committed by laxman
Browse files

Synchronize codes for Nord Oxygen OS 11.1.1.3.AC01DA

Add NULL check for kref_put to resolve the kernel panic

Change-Id: Ic65ddfadecca5322c1b58c372feba7a14642c0b3
parent 0e187622
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -597,7 +597,12 @@ int cam_context_deinit(struct cam_context *ctx)

void cam_context_putref(struct cam_context *ctx)
{
	if (kref_read(&ctx->refcount))
		kref_put(&ctx->refcount, cam_node_put_ctxt_to_free_list);
	else
		WARN(1, "ctx %s %d state %d devhdl %X\n", ctx->dev_name,
			ctx->ctx_id, ctx->state, ctx->dev_hdl);

	CAM_DBG(CAM_CORE,
		"ctx device hdl %ld, ref count %d, dev_name %s",
		ctx->dev_hdl, refcount_read(&(ctx->refcount.refcount)),