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

Commit bf903c47 authored by Andrey Markovytch's avatar Andrey Markovytch Committed by Gerrit - the friendly Code Review server
Browse files

ice: fix security issue with validating error in pointer



get_ice_device_from_storage_type can return error pointer which is
not NULL in case of error, this was not checked, changes fix this.

Change-Id: I7dd8a068454a7bd250189ff9467c685af449f81b
Signed-off-by: default avatarAndrey Markovytch <andreym@codeaurora.org>
parent 05c7d0a1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1651,6 +1651,9 @@ int qcom_ice_setup_ice_hw(const char *storage_type, int enable)
	struct ice_device *ice_dev = NULL;

	ice_dev = get_ice_device_from_storage_type(storage_type);
	if (ice_dev == ERR_PTR(-EPROBE_DEFER))
		return -EPROBE_DEFER;

	if (!ice_dev)
		return ret;