• Ian Abbott's avatar
    comedi: check data length for INSN_CONFIG_GET_PWM_OUTPUT · 863cf332
    Ian Abbott authored
    Comedi INSN_CONFIG instructions have different expected instructtion
    data lengths depending on the type of configuration instruction
    specified by the first word of data.  This is checked by
    `check_insn_config_length()`.  There are a few configuration
    instructions whose data lengths are not currently checked, usually for
    rare configuration instructions that are implemented differently by
    different drivers.  For unknown configuration instructions, the function
    logs a warning and accepts the specified data length.
    
    The `INSN_CONFIG_GET_PWM_OUTPUT` configuration instruction length is not
    currently checked, but all the places it is currently used expect a data
    length of 3.  (These places are `ni_get_pwm_config()` in
    "ni_mio_common.c", and `pci1760_pwm_insn_config()` in "adv_pci1760.c".)
    Make this length official by checking it in
    `check_insn_config_length()`.
    Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
    Link: https://lore.kernel.org/r/20230103151127.19287-1-abbotti@mev.co.ukSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    863cf332
comedi_fops.c 79.9 KB