Back out previous, fix PR kern/49411 correctly.
frame->header.length is not initialized in the vendor packet case. Instead, make hdmi_infoframe_header_pack take the packet length and subtract the size of the header when packing the header. (Could make it take the payload length instead, but for callers it is more convenient to have a name for the whole packet length.)
This commit is contained in:
parent
fb9a4560bd
commit
70976b8e2d
16
sys/external/bsd/drm2/include/linux/hdmi.h
vendored
16
sys/external/bsd/drm2/include/linux/hdmi.h
vendored
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: hdmi.h,v 1.3 2014/11/23 16:07:10 riastradh Exp $ */
|
||||
/* $NetBSD: hdmi.h,v 1.4 2014/11/23 16:16:29 riastradh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2014 The NetBSD Foundation, Inc.
|
||||
@ -203,7 +203,7 @@ hdmi_infoframe_header_pack(const struct hdmi_infoframe_header *header,
|
||||
|
||||
p[0] = header->type;
|
||||
p[1] = header->version;
|
||||
p[2] = length;
|
||||
p[2] = (length - HDMI_INFOFRAME_HEADER_SIZE);
|
||||
p[3] = 0; /* checksum */
|
||||
|
||||
return HDMI_INFOFRAME_HEADER_SIZE;
|
||||
@ -260,8 +260,7 @@ hdmi_audio_infoframe_pack(const struct hdmi_audio_infoframe *frame, void *buf,
|
||||
|
||||
KASSERT(frame->header.length == HDMI_AUDIO_INFOFRAME_SIZE);
|
||||
|
||||
ret = hdmi_infoframe_header_pack(&frame->header, frame->header.length,
|
||||
p, size);
|
||||
ret = hdmi_infoframe_header_pack(&frame->header, length, p, size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
KASSERT(ret == HDMI_INFOFRAME_HEADER_SIZE);
|
||||
@ -337,8 +336,7 @@ hdmi_avi_infoframe_pack(const struct hdmi_avi_infoframe *frame, void *buf,
|
||||
|
||||
KASSERT(frame->header.length == HDMI_AVI_INFOFRAME_SIZE);
|
||||
|
||||
ret = hdmi_infoframe_header_pack(&frame->header, frame->header.length,
|
||||
p, size);
|
||||
ret = hdmi_infoframe_header_pack(&frame->header, length, p, size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
KASSERT(ret == HDMI_INFOFRAME_HEADER_SIZE);
|
||||
@ -428,8 +426,7 @@ hdmi_spd_infoframe_pack(struct hdmi_spd_infoframe *frame, void *buf,
|
||||
|
||||
KASSERT(frame->header.length == HDMI_SPD_INFOFRAME_SIZE);
|
||||
|
||||
ret = hdmi_infoframe_header_pack(&frame->header, frame->header.length,
|
||||
p, size);
|
||||
ret = hdmi_infoframe_header_pack(&frame->header, length, p, size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
KASSERT(ret == HDMI_INFOFRAME_HEADER_SIZE);
|
||||
@ -496,8 +493,7 @@ hdmi_vendor_infoframe_pack(const struct hdmi_vendor_infoframe *frame,
|
||||
if (frame->s3d_struct >= HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF)
|
||||
length += 1;
|
||||
|
||||
ret = hdmi_infoframe_header_pack(&frame->header, frame->header.length,
|
||||
p, size);
|
||||
ret = hdmi_infoframe_header_pack(&frame->header, length, p, size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
KASSERT(ret == HDMI_INFOFRAME_HEADER_SIZE);
|
||||
|
Loading…
Reference in New Issue
Block a user