NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/49411: Pass invalid length to hdmi_infoframe_header_pack() in hdmi.h



>Number:         49411
>Category:       kern
>Synopsis:       Pass invalid length to hdmi_infoframe_header_pack() in hdmi.h
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 23 10:35:01 +0000 2014
>Originator:     HITOSHI Osada
>Release:        NetBSD 7.99.1
>Organization:
>Environment:
NetBSD amd785g 7.99.1 NetBSD 7.99.1 (AMD785GKMS) #0: Sun Nov 23 17:51:09 JST 2014  root@amd785g:/tmp/obj/sys/arch/amd64/compile/AMD785GKMS amd64
>Description:
The second argument of hdmi_infoframe_header_pack() should be 'infoframe body length', not 'infoframe packet length'.

>How-To-Repeat:

>Fix:
Index: hdmi.h
===================================================================
RCS file: /cvsroot/src/sys/external/bsd/drm2/include/linux/hdmi.h,v
retrieving revision 1.2
diff -u -r1.2 hdmi.h
--- hdmi.h      16 Jul 2014 20:59:58 -0000      1.2
+++ hdmi.h      23 Nov 2014 10:10:47 -0000
@@ -260,7 +260,7 @@

        KASSERT(frame->header.length == HDMI_AUDIO_INFOFRAME_SIZE);

-       ret = hdmi_infoframe_header_pack(&frame->header, length, p, size);
+       ret = hdmi_infoframe_header_pack(&frame->header, frame->header.length, p, size);
        if (ret < 0)
                return ret;
        p += HDMI_INFOFRAME_HEADER_SIZE;
@@ -335,7 +335,7 @@

        KASSERT(frame->header.length == HDMI_AVI_INFOFRAME_SIZE);

-       ret = hdmi_infoframe_header_pack(&frame->header, length, p, size);
+       ret = hdmi_infoframe_header_pack(&frame->header, frame->header.length, p, size);
        if (ret < 0)
                return ret;
        p += HDMI_INFOFRAME_HEADER_SIZE;
@@ -424,7 +424,7 @@

        KASSERT(frame->header.length == HDMI_SPD_INFOFRAME_SIZE);

-       ret = hdmi_infoframe_header_pack(&frame->header, length, p, size);
+       ret = hdmi_infoframe_header_pack(&frame->header, frame->header.length, p, size);
        if (ret < 0)
                return ret;
        p += HDMI_INFOFRAME_HEADER_SIZE;
@@ -490,7 +490,7 @@
        if (frame->s3d_struct >= HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF)
                length += 1;

-       ret = hdmi_infoframe_header_pack(&frame->header, length, p, size);
+       ret = hdmi_infoframe_header_pack(&frame->header, frame->header.length, p, size);
        if (ret < 0)
                return ret;
        p += HDMI_INFOFRAME_HEADER_SIZE;



Home | Main Index | Thread Index | Old Index