Skip to content
  • channing's avatar
    misc: st_core: Error triggered by convert "char" to "int" · 25c22d5b
    channing authored
    
    
    When st driver decodes protocol index received from raw data,
    it does a value convert from "char" to "int". Because it's sign
    extension from bit8 to bit32, the "int" value maybe minus, in
    another word, the protocol index might be minus, but driver doesn't
    filter such case and may continue access memory pointed by this
    minus index.
    
    This patch is to change the variable type of index from "int"
    to "unsigned char", so that it avoids do such kind of type
    conversion.
    
    cc: liu chuansheng <chuansheng.liu@intel.com>
    Signed-off-by: default avatarchanning <chao.bi@intel.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    25c22d5b