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

Commit 00a6691d authored by Ido Shayevitz's avatar Ido Shayevitz Committed by Stephen Boyd
Browse files

usb: msm_otg: Fix null ref pointer crash for some targets



Adding a check to ensure bus_scale_table exists in the platform data
before accessing it. This fix is good for targets which do not have
the bus_scale_table defined in the platform data.

Change-Id: I4ec1ce53b4b7cf545e8aae207e611fb8402ab491
Signed-off-by: default avatarIdo Shayevitz <idos@codeaurora.org>
parent e672d0d4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -863,7 +863,8 @@ static void msm_otg_bus_vote(struct msm_otg *motg, enum usb_bus_vote vote)
	struct msm_otg_platform_data *pdata = motg->pdata;

	/* Check if target allows min_vote to be same as no_vote */
	if (vote >= pdata->bus_scale_table->num_usecases)
	if (pdata->bus_scale_table &&
	    vote >= pdata->bus_scale_table->num_usecases)
		vote = USB_NO_PERF_VOTE;

	if (motg->bus_perf_client) {