Showing error 1746

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: drivers/scsi/sg.c
Line in file: 2580
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-10 20:24:52 UTC


Source:

2550                                seq_printf(s, " t_o/elap=%d/%d",
2551                                        (new_interface ? hp->timeout :
2552                                                  jiffies_to_msecs(fp->timeout)),
2553                                        (ms > hp->duration ? ms - hp->duration : 0));
2554                        }
2555                        seq_printf(s, "ms sgat=%d op=0x%02x\n", usg,
2556                                   (int) srp->data.cmd_opcode);
2557                }
2558                if (0 == m)
2559                        seq_printf(s, "     No requests active\n");
2560        }
2561}
2562
2563static int sg_proc_open_debug(struct inode *inode, struct file *file)
2564{
2565        return seq_open(file, &debug_seq_ops);
2566}
2567
2568static int sg_proc_seq_show_debug(struct seq_file *s, void *v)
2569{
2570        struct sg_proc_deviter * it = (struct sg_proc_deviter *) v;
2571        Sg_device *sdp;
2572
2573        if (it && (0 == it->index)) {
2574                seq_printf(s, "max_active_device=%d(origin 1)\n",
2575                           (int)it->max);
2576                seq_printf(s, " def_reserved_size=%d\n", sg_big_buff);
2577        }
2578        sdp = it ? sg_get_dev(it->index) : NULL;
2579        if (sdp) {
2580                struct scsi_device *scsidp = sdp->device;
2581
2582                if (NULL == scsidp) {
2583                        seq_printf(s, "device %d detached ??\n", 
2584                                   (int)it->index);
2585                        return 0;
2586                }
2587
2588                if (sg_get_nth_sfp(sdp, 0)) {
2589                        seq_printf(s, " >>> device=%s ",
2590                                sdp->disk->disk_name);
Show full sources