android_kernel_samsung_msm8976/drivers/uio
Dan Carpenter b4de4b6031 uio: Fix an Oops on load
commit 432798195bbce1f8cd33d1c0284d0538835e25fb upstream.

I was trying to solve a double free but I introduced a more serious
NULL dereference bug.  The problem is that if there is an IRQ which
triggers immediately, then we need "info->uio_dev" but it's not set yet.

This patch puts the original initialization back to how it was and just
sets info->uio_dev to NULL on the error path so it should solve both
the Oops and the double free.

Fixes: f019f07ecf6a ("uio: potential double frees if __uio_register_device() fails")
Reported-by: Mathias Thore <Mathias.Thore@infinera.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Tested-by: Mathias Thore <Mathias.Thore@infinera.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-07-27 22:06:01 +02:00
..
msm_sharedmem
Kconfig
Makefile
uio.c uio: Fix an Oops on load 2019-07-27 22:06:01 +02:00
uio_aec.c
uio_cif.c
uio_dmem_genirq.c uio: fix dmem_region_start computation 2019-07-27 21:42:50 +02:00
uio_netx.c
uio_pci_generic.c
uio_pdrv.c
uio_pdrv_genirq.c
uio_pruss.c
uio_sercos3.c