linux/drivers/staging
Mathieu Desnoyers e5f7787388 lttng lib: ring buffer remove duplicate null pointer
* Dan Carpenter <dan.carpenter@oracle.com> wrote:
> The patch c844b2f5cf: "lttng lib: ring buffer" from Nov 28, 2011,
> leads to the following Smatch complaint:
>
> drivers/staging/lttng/lib/ringbuffer/ring_buffer_mmap.c +33
> +lib_ring_buffer_fault()
>          warn: variable dereferenced before check 'buf' (see line 26)
>
> drivers/staging/lttng/lib/ringbuffer/ring_buffer_mmap.c
>     25          struct lib_ring_buffer *buf = vma->vm_private_data;
>     26          struct channel *chan = buf->backend.chan;
>                                        ^^^^^^^^^^^^^^^^^
> Dereference.
>
>     27          const struct lib_ring_buffer_config *config = chan->backend.config;
>     28          pgoff_t pgoff = vmf->pgoff;
>     29          struct page **page;
>     30          void **virt;
>     31          unsigned long offset, sb_bindex;
>     32
>     33          if (!buf)
>                     ^^^^
> Check.
>
>     34                  return VM_FAULT_OOM;
>     35

This check is performed at mapping setup time in
lib_ring_buffer_mmap_buf() already, so we can safely remove this
duplicata.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-01 09:37:47 -08:00
..
android staging: android: ram_console: pass in a boot info string 2011-11-30 21:23:37 +09:00
asus_oled Staging: asus_oled: Fixed use of obsolete function. 2011-11-26 18:13:54 -08:00
bcm Staging: bcm: Reverse semaphore locking in IOCTL_BCM_BUFFER_DOWNLOAD_STOP. 2011-11-29 10:09:52 +09:00
comedi Staging: comedi: fix brace coding style issue in pcmuio.c 2011-11-26 18:51:41 -08:00
cptm1217
crystalhd
cxt1e1 Staging: cxt1e1: remove rcs keywords and log 2011-11-26 18:11:35 -08:00
echo
et131x staging: et131x: Remove section comments 2011-11-26 16:21:24 -08:00
frontier Staging: frontier: Removed use of obsolete function 2011-11-26 18:13:54 -08:00
ft1000
gma500 gma500: mark staging broken 2011-11-26 16:05:13 -08:00
hv staging: hv: move hv_netvsc out of staging area 2011-11-29 16:12:36 +09:00
iio Staging: iio/accel: Changed return type of lis3l02dq_read_event_config() to int 2011-11-30 19:37:33 +09:00
intel_sst staging: Add module.h to more drivers implicitly using it. 2011-10-31 19:32:10 -04:00
keucr
line6 Staging: line6: Use kmemdup rather than duplicating its implementation 2011-11-26 16:14:57 -08:00
lttng lttng lib: ring buffer remove duplicate null pointer 2011-12-01 09:37:47 -08:00
media media/staging: fix allyesconfig build error 2011-11-17 10:29:02 -02:00
mei staging/mei: don't check if list is empty before looping 2011-11-28 06:46:18 +09:00
nvec staging: nvec: add device tree support 2011-11-26 17:17:14 -08:00
octeon STAGING: octeon-ethernet: Fix compile error caused by skb_frag_struct change 2011-11-09 17:14:27 +00:00
olpc_dcon
omapdrm staging: add omapdrm DRM/KMS driver for TI OMAP platforms 2011-11-26 17:43:30 -08:00
panel
phison staging/phison: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used) 2011-11-28 04:24:32 +09:00
pohmelfs filesystems: add set_nlink() 2011-11-02 12:53:43 +01:00
quatech_usb2
quickstart
rtl8187se Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging 2011-10-26 15:39:02 +02:00
rtl8192e rtl8192e: Rename clashing symbols 2011-11-30 14:16:42 -08:00
rtl8192u Staging: rtl8192u: remove api.c file 2011-11-26 16:25:54 -08:00
rtl8712 drivers/staging/rtl8712/rtl871x_mlme.c: eliminate a null pointer dereference 2011-11-26 17:19:23 -08:00
rts5139 staging: Add export.h for THIS_MODULE/EXPORT_SYMBOL to drivers/staging users. 2011-10-31 19:32:08 -04:00
rts_pstor drivers: staging: rts_pstor fixed checkpatch warnings 2011-10-17 15:17:17 -07:00
sbe-2t3e3
sep Staging: sep: potential buffer overflow in ioctl 2011-11-26 17:23:57 -08:00
serial m68k/serial: Remove obsolete IRQ_FLG_* users 2011-11-26 16:22:27 -08:00
serqt_usb2
slicoss staging: slicoss depends on NET 2011-11-18 15:00:48 -08:00
sm7xx staging/sm7xx: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used) 2011-11-28 04:24:32 +09:00
speakup Staging: speakup: Don't try to access an unallocated struct. 2011-11-26 18:13:55 -08:00
ste_rmi4
tidspbridge staging: tidspbridge: request dmtimer clocks on init 2011-11-26 18:12:57 -08:00
usbip staging: Add module.h to more drivers implicitly using it. 2011-10-31 19:32:10 -04:00
vme Staging: VME: PIO2: Correct irq reset 2011-11-30 19:37:33 +09:00
vt6655 staging: vt6655: integer overflows in private_ioctl() 2011-11-30 19:29:40 +09:00
vt6656 staging: vt6656: integer overflows in private_ioctl() 2011-11-30 19:29:40 +09:00
winbond staging: Add module.h to more drivers implicitly using it. 2011-10-31 19:32:10 -04:00
wlags49_h2 staging/wlags49_h2: Convert pci_table entries to PCI_DEVICE (if PCI_ANY_ID is used) 2011-11-28 04:24:32 +09:00
wlags49_h25 Staging: wlags49_h25: Makefile: remove unneeded stuff 2011-10-18 13:36:04 -07:00
wlan-ng
xgifb staging: xgifb: vb_setmode: clean up a single statement if 2011-11-28 06:20:14 +09:00
zcache Staging: zcache: Fix calls to obsolete function 2011-11-26 18:13:55 -08:00
zram Merge branch 'for-3.2/core' of git://git.kernel.dk/linux-block 2011-11-04 17:06:58 -07:00
Kconfig Staging: android: add the code back to the build 2011-11-30 20:33:10 +09:00
Makefile Staging: android: add the code back to the build 2011-11-30 20:33:10 +09:00
staging.c