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

Commit 205b3c5d authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa: revert gsi check for erindex"

parents a257414e ecbabdc8
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -2313,17 +2313,20 @@ int gsi_alloc_channel(struct gsi_chan_props *props, unsigned long dev_hdl,
	}
	erindex = props->evt_ring_hdl != ~0 ? props->evt_ring_hdl :
		GSI_NO_EVT_ERINDEX;
	if (erindex == GSI_NO_EVT_ERINDEX || erindex >= GSI_EVT_RING_MAX) {
	if (erindex != GSI_NO_EVT_ERINDEX && erindex >= GSI_EVT_RING_MAX) {
		GSIERR("invalid erindex %u\n", erindex);
		devm_kfree(gsi_ctx->dev, user_data);
		return -GSI_STATUS_INVALID_PARAMS;
	}

	if (erindex < GSI_EVT_RING_MAX) {
		ctx->evtr = &gsi_ctx->evtr[erindex];
		atomic_inc(&ctx->evtr->chan_ref_cnt);
		if (props->prot != GSI_CHAN_PROT_GCI &&
			ctx->evtr->props.exclusive &&
			atomic_read(&ctx->evtr->chan_ref_cnt) == 1)
			ctx->evtr->chan = ctx;
	}

	gsi_program_chan_ctx(props, gsi_ctx->per.ee, erindex);