dvb-fe: Fix check for stats property
authorMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 1 Mar 2013 13:39:29 +0000 (10:39 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 1 Mar 2013 13:42:39 +0000 (10:42 -0300)
Instead of [i], the tests were doing [2]. That broke DTV_STATUS
retrival.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
lib/libdvbv5/dvb-fe.c

index 83aaed2..155b25a 100644 (file)
@@ -758,7 +758,7 @@ struct dtv_stats *dvb_fe_retrieve_stats_layer(struct dvb_v5_fe_parms *parms,
        for (i = 0; i < DTV_NUM_STATS_PROPS; i++) {
                if (parms->stats.prop[i].cmd != cmd)
                        continue;
-               if (layer >= parms->stats.prop[2].u.st.len)
+               if (layer >= parms->stats.prop[i].u.st.len)
                        return NULL;
                return &parms->stats.prop[i].u.st.stat[layer];
        }