With the sync from Dragonfly BSD in r318216 a bug slipped in (also still present

upstream it seems).

The tlv variable was changed to a pointer but the advancement of the data pointer
was left as sizeof(tlv).  While the sizeof the (now) pointer equals the
sizeof 2 x uint32_t (size of the struct) on 64bit platforms, on 32bit platforms
the size of the advancement of the data pointer was wrong leading to
firmware load issues.

Correctly advance the data pointer by the size of the structure and not by
the size of a pointer.

PR:		219683
Submitted by:	waddlesplash gamil.com (Haiku) on irc
MFC after:	1 week
This commit is contained in:
Bjoern A. Zeeb 2019-01-15 22:31:54 +00:00
parent 89ec2f414c
commit b20d0a438e

View File

@ -626,7 +626,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode_type ucode_type)
goto parse_out;
}
len -= roundup2(tlv_len, 4);
data += sizeof(tlv) + roundup2(tlv_len, 4);
data += sizeof(*tlv) + roundup2(tlv_len, 4);
switch ((int)tlv_type) {
case IWM_UCODE_TLV_PROBE_MAX_LEN: