Showing error 752

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: drivers/media/video/videobuf-vmalloc.c
Line in file: 142
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Smatch (1.59)
Entered: 2011-11-07 22:22:22 UTC


Source:

112
113                mutex_unlock(&q->vb_lock);
114        }
115
116        return;
117}
118
119static struct vm_operations_struct videobuf_vm_ops =
120{
121        .open     = videobuf_vm_open,
122        .close    = videobuf_vm_close,
123};
124
125/* ---------------------------------------------------------------------
126 * vmalloc handlers for the generic methods
127 */
128
129/* Allocated area consists on 3 parts:
130        struct video_buffer
131        struct <driver>_buffer (cx88_buffer, saa7134_buf, ...)
132        struct videobuf_dma_sg_memory
133 */
134
135static void *__videobuf_alloc(size_t size)
136{
137        struct videobuf_vmalloc_memory *mem;
138        struct videobuf_buffer *vb;
139
140        vb = kzalloc(size+sizeof(*mem),GFP_KERNEL);
141
142        mem = vb->priv = ((char *)vb)+size;
143        mem->magic=MAGIC_VMAL_MEM;
144
145        dprintk(1,"%s: allocated at %p(%ld+%ld) & %p(%ld)\n",
146                __func__,vb,(long)sizeof(*vb),(long)size-sizeof(*vb),
147                mem,(long)sizeof(*mem));
148
149        return vb;
150}
151
152static int __videobuf_iolock (struct videobuf_queue* q,
Show full sources