linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: aaro.koskinen@iki.fi (Aaro Koskinen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] dma: mv_xor: fix kernel crash on probe error
Date: Thu, 12 Dec 2013 23:11:55 +0200	[thread overview]
Message-ID: <1386882715-16433-1-git-send-email-aaro.koskinen@iki.fi> (raw)

If the non-DT channel add path fails, the kernel will crash as the
channel is not set to NULL and it will try to release the channel using
the error value. Fix that.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 drivers/dma/mv_xor.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 7807f0ef4e20..2cb35a62c7f0 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -1227,6 +1227,7 @@ static int mv_xor_probe(struct platform_device *pdev)
 						   cd->cap_mask, irq);
 			if (IS_ERR(xordev->channels[i])) {
 				ret = PTR_ERR(xordev->channels[i]);
+				xordev->channels[i] = NULL;
 				goto err_channel_add;
 			}
 		}
-- 
1.8.5.1

             reply	other threads:[~2013-12-12 21:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-12 21:11 Aaro Koskinen [this message]
2013-12-12 21:15 ` [PATCH] dma: mv_xor: fix kernel crash on probe error Jason Cooper
2013-12-12 22:42 ` Russell King - ARM Linux
2013-12-12 23:36   ` Dan Williams
2013-12-12 23:44     ` Aaro Koskinen
2013-12-12 23:59       ` Russell King - ARM Linux
2013-12-18 16:35         ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1386882715-16433-1-git-send-email-aaro.koskinen@iki.fi \
    --to=aaro.koskinen@iki.fi \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).