• Lee, Chun-Yi's avatar
    acer-wmi: fix obj is NULL but dereferenced · f20aaba9
    Lee, Chun-Yi authored
    Fengguang Wu run coccinelle and warns about:
      drivers/platform/x86/acer-wmi.c:1200:17-21: ERROR: obj is NULL but dereferenced.
      drivers/platform/x86/acer-wmi.c:891:17-21: ERROR: obj is NULL but dereferenced.
      drivers/platform/x86/acer-wmi.c:1953:17-21: ERROR: obj is NULL but dereferenced.
    
    It causes by the code in patch 987dfbaa doesn't check
    obj variable should not be NULL. There have risk for dereference a NULL obj, so add
    this patch to fix.
    
    Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
    Cc: Matthew Garrett <mjg@redhat.com>
    Cc: Dmitry Torokhov <dtor@mail.ru>
    Cc: Corentin Chary <corentincj@iksaif.net>
    Cc: Thomas Renninger <trenn@suse.de>
    Signed-off-by: default avatarLee, Chun-Yi <jlee@suse.com>
    Signed-off-by: default avatarMatthew Garrett <matthew.garrett@nebula.com>
    f20aaba9
acer-wmi.c 52.5 KB