• Dan Carpenter's avatar
    pktcdvd: debugfs functions return NULL on error · 49c2856a
    Dan Carpenter authored
    My static checker complains correctly that this is potential NULL
    dereference because debugfs functions return NULL on error.  They return
    an ERR_PTR if they are configured out.
    
    We don't need to check for ERR_PTR because if debugfs is stubbed out the
    dummy functions won't complain about that.  We don't need to check the
    values before calling debugfs_remove() because that accepts ERR_PTRs and
    NULL pointers.
    
    We don't need to set pkt->dfs_f_info to NULL in pkt_debugfs_dev_new()
    because it was initialized with kzalloc() so I have removed that.
    Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
    49c2856a
pktcdvd.c 73.4 KB