Showing error 1735

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: drivers/misc/c2port/core.c
Line in file: 988
Project: Linux Kernel
Project version: 2.6.28
Confirmation: Fixed by 22ea71d7f49c3115e3a9ced5eac109fef26d3559
Tools: Smatch (1.59)
Entered: 2013-09-10 20:24:52 UTC


Source:

 958        if (!c2dev)
 959                return;
 960
 961        dev_info(c2dev->dev, "C2 port %s removed\n", c2dev->name);
 962
 963        device_remove_bin_file(c2dev->dev, &c2port_bin_attrs);
 964        spin_lock_irq(&c2port_idr_lock);
 965        idr_remove(&c2port_idr, c2dev->id);
 966        spin_unlock_irq(&c2port_idr_lock);
 967
 968        device_destroy(c2port_class, c2dev->id);
 969
 970        kfree(c2dev);
 971}
 972EXPORT_SYMBOL(c2port_device_unregister);
 973
 974/*
 975 * Module stuff
 976 */
 977
 978static int __init c2port_init(void)
 979{
 980        printk(KERN_INFO "Silicon Labs C2 port support v. " DRIVER_VERSION
 981                " - (C) 2007 Rodolfo Giometti\n");
 982
 983        c2port_class = class_create(THIS_MODULE, "c2port");
 984        if (!c2port_class) {
 985                printk(KERN_ERR "c2port: failed to allocate class\n");
 986                return -ENOMEM;
 987        }
 988        c2port_class->dev_attrs = c2port_attrs;
 989
 990        return 0;
 991}
 992
 993static void __exit c2port_exit(void)
 994{
 995        class_destroy(c2port_class);
 996}
 997
 998module_init(c2port_init);
Show full sources