From: Damian Hobson-Garcia Date: Fri, 16 Nov 2012 05:46:12 +0000 (+0900) Subject: drivers: uio: Only allocate new private data when probing device tree node X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d5185c4eb3a022f7e7a435238c2b0b885e6b4821;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git drivers: uio: Only allocate new private data when probing device tree node The same condition should be used both when allocating and freeing the driver private data. When dev.of_node is non NULL, allocate a new private data structure, otherwise use the values from the platform data. Reported-by: Fengguang Wu Signed-off-by: Damian Hobson-Garcia Cc: "Hans J. Koch" Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/uio/uio_dmem_genirq.c b/drivers/uio/uio_dmem_genirq.c index bbdf92559e3f..252434c9ea9d 100644 --- a/drivers/uio/uio_dmem_genirq.c +++ b/drivers/uio/uio_dmem_genirq.c @@ -153,7 +153,7 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev) int ret = -EINVAL; int i; - if (!uioinfo) { + if (pdev->dev.of_node) { int irq; /* alloc uioinfo for one device */ diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c index ac988ce62f2b..c122bca669b6 100644 --- a/drivers/uio/uio_pdrv_genirq.c +++ b/drivers/uio/uio_pdrv_genirq.c @@ -102,7 +102,7 @@ static int uio_pdrv_genirq_probe(struct platform_device *pdev) int ret = -EINVAL; int i; - if (!uioinfo) { + if (pdev->dev.of_node) { int irq; /* alloc uioinfo for one device */