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

Commit e38e1289 authored by Ville Syrjälä's avatar Ville Syrjälä
Browse files

drm/dp/mst: Use memchr_inv() instead of memcmp() against a zeroed array

parent a4370c77
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -1337,16 +1337,18 @@ static void drm_dp_mst_link_probe_work(struct work_struct *work)
static bool drm_dp_validate_guid(struct drm_dp_mst_topology_mgr *mgr,
				 u8 *guid)
{
	static u8 zero_guid[16];
	u64 salt;

	if (memchr_inv(guid, 0, 16))
		return true;

	salt = get_jiffies_64();

	if (!memcmp(guid, zero_guid, 16)) {
		u64 salt = get_jiffies_64();
	memcpy(&guid[0], &salt, sizeof(u64));
	memcpy(&guid[8], &salt, sizeof(u64));

	return false;
}
	return true;
}

#if 0
static int build_dpcd_read(struct drm_dp_sideband_msg_tx *msg, u8 port_num, u32 offset, u8 num_bytes)