Showing error 1858

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


Source:

428        ssize_t result;
429        u16 cat;
430        mutex_lock(&wlp->mutex);
431        if (wlp->dev_info == NULL) {
432                result = __wlp_alloc_device_info(wlp);
433                if (result < 0)
434                        goto out;
435        }
436        result = sscanf(buf, "%hu", &cat);
437        if ((cat >= WLP_DEV_CAT_COMPUTER && cat <= WLP_DEV_CAT_TELEPHONE)
438            || cat == WLP_DEV_CAT_OTHER)
439                wlp->dev_info->prim_dev_type.category = cat;
440        else
441                result = -EINVAL;
442out:
443        mutex_unlock(&wlp->mutex);
444        return result < 0 ? result : size;
445}
446EXPORT_SYMBOL_GPL(wlp_dev_prim_category_store);
447
448ssize_t wlp_dev_prim_OUI_show(struct wlp *wlp, char *buf)
449{
450        ssize_t result = 0;
451        mutex_lock(&wlp->mutex);
452        if (wlp->dev_info == NULL) {
453                result = __wlp_setup_device_info(wlp);
454                if (result < 0)
455                        goto out;
456        }
457        result = scnprintf(buf, PAGE_SIZE, "%02x:%02x:%02x\n",
458                           wlp->dev_info->prim_dev_type.OUI[0],
459                           wlp->dev_info->prim_dev_type.OUI[1],
460                           wlp->dev_info->prim_dev_type.OUI[2]);
461out:
462        mutex_unlock(&wlp->mutex);
463        return result;
464}
465EXPORT_SYMBOL_GPL(wlp_dev_prim_OUI_show);
466
467ssize_t wlp_dev_prim_OUI_store(struct wlp *wlp, const char *buf, size_t size)
468{
Show full sources