Showing error 1856

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


Source:

388                                              "Copier",
389        [WLP_DEV_CAT_CAMERA] = "Camera",
390        [WLP_DEV_CAT_STORAGE] = "Storage Network",
391        [WLP_DEV_CAT_INFRASTRUCTURE] = "Infrastructure",
392        [WLP_DEV_CAT_DISPLAY] = "Display",
393        [WLP_DEV_CAT_MULTIM] = "Multimedia device",
394        [WLP_DEV_CAT_GAMING] = "Gaming device",
395        [WLP_DEV_CAT_TELEPHONE] = "Telephone",
396        [WLP_DEV_CAT_OTHER] = "Other",
397};
398
399static
400const char *wlp_dev_category_str(unsigned cat)
401{
402        if ((cat >= WLP_DEV_CAT_COMPUTER && cat <= WLP_DEV_CAT_TELEPHONE)
403            || cat == WLP_DEV_CAT_OTHER)
404                return __wlp_dev_category[cat];
405        return "unknown category";
406}
407
408ssize_t wlp_dev_prim_category_show(struct wlp *wlp, char *buf)
409{
410        ssize_t result = 0;
411        mutex_lock(&wlp->mutex);
412        if (wlp->dev_info == NULL) {
413                result = __wlp_setup_device_info(wlp);
414                if (result < 0)
415                        goto out;
416        }
417        result = scnprintf(buf, PAGE_SIZE, "%s\n",
418                  wlp_dev_category_str(wlp->dev_info->prim_dev_type.category));
419out:
420        mutex_unlock(&wlp->mutex);
421        return result;
422}
423EXPORT_SYMBOL_GPL(wlp_dev_prim_category_show);
424
425ssize_t wlp_dev_prim_category_store(struct wlp *wlp, const char *buf,
426                                    size_t size)
427{
428        ssize_t result;
Show full sources