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

Commit afff74a3 authored by Subhash Jadavani's avatar Subhash Jadavani Committed by David Keitel
Browse files

scsi: ufs-qcom-ice: add null pointer check



ufs_qcom_ice_req_setup() function might access the uninitialized pointers,
this change makes sure that there are no null pointer accesses.

Change-Id: I83c3e2f015a474d5eba6ddaeeaa860e79717760f
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
parent 1057b440
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -217,6 +217,12 @@ int ufs_qcom_ice_req_setup(struct ufs_qcom_host *qcom_host,
	char cmd_op = cmd->cmnd[0];
	int err;

	if (!qcom_host->ice.pdev || !qcom_host->ice.vops) {
		dev_dbg(qcom_host->hba->dev, "%s: ice device is not enabled\n",
			__func__);
		return 0;
	}

	if (qcom_host->ice.vops->config) {
		memset(&ice_set, 0, sizeof(ice_set));
		err = qcom_host->ice.vops->config(qcom_host->ice.pdev,