Showing error 1861

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: 522
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-11 08:47:26 UTC


Source:

492{
493        ssize_t result = 0;
494        mutex_lock(&wlp->mutex);
495        if (wlp->dev_info == NULL) {
496                result = __wlp_setup_device_info(wlp);
497                if (result < 0)
498                        goto out;
499        }
500        result = scnprintf(buf, PAGE_SIZE, "%u\n",
501                           wlp->dev_info->prim_dev_type.OUIsubdiv);
502out:
503        mutex_unlock(&wlp->mutex);
504        return result;
505}
506EXPORT_SYMBOL_GPL(wlp_dev_prim_OUI_sub_show);
507
508ssize_t wlp_dev_prim_OUI_sub_store(struct wlp *wlp, const char *buf,
509                                   size_t size)
510{
511        ssize_t result;
512        unsigned sub;
513        u8 max_sub = ~0;
514        mutex_lock(&wlp->mutex);
515        if (wlp->dev_info == NULL) {
516                result = __wlp_alloc_device_info(wlp);
517                if (result < 0)
518                        goto out;
519        }
520        result = sscanf(buf, "%u", &sub);
521        if (sub <= max_sub)
522                wlp->dev_info->prim_dev_type.OUIsubdiv = sub;
523        else
524                result = -EINVAL;
525out:
526        mutex_unlock(&wlp->mutex);
527        return result < 0 ? result : size;
528}
529EXPORT_SYMBOL_GPL(wlp_dev_prim_OUI_sub_store);
530
531ssize_t wlp_dev_prim_subcat_show(struct wlp *wlp, char *buf)
532{
Show full sources