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

Commit 2dac08c9 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Add NULL check for bus vote data allocation"

parents a04c9614 cb75d25f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1693,6 +1693,12 @@ static int venus_hfi_core_init(void *device)

	dev->bus_vote.data =
		kzalloc(sizeof(struct vidc_bus_vote_data), GFP_KERNEL);
	if (!dev->bus_vote.data) {
		dprintk(VIDC_ERR, "Bus vote data memory is not allocated\n");
		rc = -ENOMEM;
		goto err_no_mem;
	}

	dev->bus_vote.data_count = 1;
	dev->bus_vote.data->power_mode = VIDC_POWER_TURBO;

@@ -1769,6 +1775,7 @@ static int venus_hfi_core_init(void *device)
	__set_state(dev, VENUS_STATE_DEINIT);
	__unload_fw(dev);
err_load_fw:
err_no_mem:
	dprintk(VIDC_ERR, "Core init failed\n");
	mutex_unlock(&dev->lock);
	return rc;