linux-brain/drivers/uio
Dan Carpenter 1582f07e88 uio: Fix an Oops on load
commit 432798195b 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: f019f07ecf ("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>
Cc: stable <stable@vger.kernel.org>
Tested-by: Mathias Thore <Mathias.Thore@infinera.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-27 16:08:02 +01:00
..
Kconfig uio: UIO_PRUSS should depend on HAS_DMA 2015-08-05 13:25:59 -07:00
Makefile uio: uio_fsl_elbc_gpcm: new driver 2015-01-12 05:04:13 -08:00
uio.c uio: Fix an Oops on load 2018-11-27 16:08:02 +01:00
uio_aec.c uio: uio_aec: remove unnecessary pci_set_drvdata() 2013-09-26 08:47:25 -07:00
uio_cif.c uio: uio_cif: remove unnecessary pci_set_drvdata() 2013-09-26 08:47:25 -07:00
uio_dmem_genirq.c uio: fix dmem_region_start computation 2016-10-31 04:13:59 -06:00
uio_fsl_elbc_gpcm.c uio: uio_fsl_elbc_gpcm: Fix module autoload for OF platform driver 2015-10-04 12:32:25 +01:00
uio_mf624.c uio: uio_mf624: remove DEFINE_PCI_DEVICE_TABLE macro 2013-12-08 22:41:48 -08:00
uio_netx.c uio: uio_netx: remove unnecessary pci_set_drvdata() 2013-09-26 08:47:25 -07:00
uio_pci_generic.c uio/uio_pci_generic: don't return zero on failure path in probe() 2015-01-12 05:04:12 -08:00
uio_pdrv_genirq.c Revert "uio: constify of_device_id array" 2015-04-03 16:04:21 +02:00
uio_pruss.c uio: pruss: Include <linux/sizes.h> 2015-06-12 17:01:43 -07:00
uio_sercos3.c uio: uio_sercos3: remove unnecessary pci_set_drvdata() 2013-09-26 08:47:25 -07:00