[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20120928201514.599733596@linuxfoundation.org>
Date: Fri, 28 Sep 2012 13:15:31 -0700
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
alan@...rguk.ukuu.org.uk, Sachin Kamat <sachin.kamat@...aro.org>,
Jassi Brar <jassisinghbrar@...il.com>,
Vinod Koul <vinod.koul@...ux.intel.com>
Subject: [ 114/218] DMA: PL330: Check the pointer returned by kzalloc
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sachin Kamat <sachin.kamat@...aro.org>
commit 61c6e7531d3b66b33187b8cdd700fd8ab93ffd62 upstream.
kzalloc could return NULL. Hence add a check to avoid
NULL pointer dereference.
Signed-off-by: Sachin Kamat <sachin.kamat@...aro.org>
Acked-by: Jassi Brar <jassisinghbrar@...il.com>
Signed-off-by: Vinod Koul <vinod.koul@...ux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/dma/pl330.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2937,6 +2937,11 @@ pl330_probe(struct amba_device *adev, co
num_chan = max_t(int, pi->pcfg.num_peri, pi->pcfg.num_chan);
pdmac->peripherals = kzalloc(num_chan * sizeof(*pch), GFP_KERNEL);
+ if (!pdmac->peripherals) {
+ ret = -ENOMEM;
+ dev_err(&adev->dev, "unable to allocate pdmac->peripherals\n");
+ goto probe_err5;
+ }
for (i = 0; i < num_chan; i++) {
pch = &pdmac->peripherals[i];
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists