Showing error 1863

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: drivers/uwb/wlp/sysfs.c
Line in file: 562
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-11 08:47:26 UTC


Source:

532{
533        ssize_t result = 0;
534        mutex_lock(&wlp->mutex);
535        if (wlp->dev_info == NULL) {
536                result = __wlp_setup_device_info(wlp);
537                if (result < 0)
538                        goto out;
539        }
540        result = scnprintf(buf, PAGE_SIZE, "%u\n",
541                           wlp->dev_info->prim_dev_type.subID);
542out:
543        mutex_unlock(&wlp->mutex);
544        return result;
545}
546EXPORT_SYMBOL_GPL(wlp_dev_prim_subcat_show);
547
548ssize_t wlp_dev_prim_subcat_store(struct wlp *wlp, const char *buf,
549                                  size_t size)
550{
551        ssize_t result;
552        unsigned sub;
553        __le16 max_sub = ~0;
554        mutex_lock(&wlp->mutex);
555        if (wlp->dev_info == NULL) {
556                result = __wlp_alloc_device_info(wlp);
557                if (result < 0)
558                        goto out;
559        }
560        result = sscanf(buf, "%u", &sub);
561        if (sub <= max_sub)
562                wlp->dev_info->prim_dev_type.subID = sub;
563        else
564                result = -EINVAL;
565out:
566        mutex_unlock(&wlp->mutex);
567        return result < 0 ? result : size;
568}
569EXPORT_SYMBOL_GPL(wlp_dev_prim_subcat_store);
570
571/**
572 * Subsystem implementation for interaction with individual WSS via sysfs
Show full sources