• Brian Rogers's avatar
    em28xx: ir-kbd-i2c init data needs a persistent object · 45af991d
    Brian Rogers authored
    commit d2ebd0f8 upstream.
    
    Original commit message:
    
    ir-kbd-i2c's ir_probe() function can be called much later (i.e. at
    ir-kbd-i2c module load), than the lifetime of a struct IR_i2c_init_data
    allocated off of the stack in cx18_i2c_new_ir() at registration time.
    Make sure we pass a pointer to a persistent IR_i2c_init_data object at
    i2c registration time.
    
    Thanks to Brian Rogers, Dustin Mitchell, Andy Walls and Jean Delvare to
    rise this question.
    
    Before this patch, if ir-kbd-i2c were probed after em28xx, trash data
    were used. After the patch, no matter what order, it is properly
    reported as tested by me:
    
    input: i2c IR (i2c IR (EM2840 Hauppaug as /class/input/input10
    ir-kbd-i2c: i2c IR (i2c IR (EM2840 Hauppaug detected at i2c-4/4-0030/ir0 [em28xx #0]
    Original-patch-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
    [brian@xyzw.org: backported for 2.6.31]
    Signed-off-by: default avatarBrian Rogers <brian@xyzw.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    45af991d
em28xx-cards.c 83 KB