• Mauro Carvalho Chehab's avatar
    [media] stv090x: add an extra protetion against buffer overflow · ffe30010
    Mauro Carvalho Chehab authored
    As pointed by smatch:
    	drivers/media/dvb-frontends/stv090x.c:2787 stv090x_optimize_carloop() error: buffer overflow 'car_loop_apsk_low' 11 <= 13
    	drivers/media/dvb-frontends/stv090x.c:2789 stv090x_optimize_carloop() error: buffer overflow 'car_loop_apsk_low' 11 <= 13
    	drivers/media/dvb-frontends/stv090x.c:2791 stv090x_optimize_carloop() error: buffer overflow 'car_loop_apsk_low' 11 <= 13
    	drivers/media/dvb-frontends/stv090x.c:2793 stv090x_optimize_carloop() error: buffer overflow 'car_loop_apsk_low' 11 <= 13
    	drivers/media/dvb-frontends/stv090x.c:2795 stv090x_optimize_carloop() error: buffer overflow 'car_loop_apsk_low' 11 <= 13
    
    The situation of a buffer overflow won't happen, in practice,
    with the current values of car_loop table. Yet, the entire logic
    that checks for those registration values is too complex. So,
    better to add an explicit check, just in case someone changes
    the car_loop tables causing a buffer overflow by mistake.
    
    This also helps to remove several smatch warnings, with is good.
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
    ffe30010
stv090x.c 137 KB