From patchwork Thu Dec 12 21:11:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaro Koskinen X-Patchwork-Id: 3334381 X-Patchwork-Delegate: dan.j.williams@gmail.com Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 04876C0D4A for ; Thu, 12 Dec 2013 21:12:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E7A8F207F4 for ; Thu, 12 Dec 2013 21:12:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CA47D207E4 for ; Thu, 12 Dec 2013 21:12:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751600Ab3LLVMY (ORCPT ); Thu, 12 Dec 2013 16:12:24 -0500 Received: from filtteri5.pp.htv.fi ([213.243.153.188]:60509 "EHLO filtteri5.pp.htv.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751621Ab3LLVMY (ORCPT ); Thu, 12 Dec 2013 16:12:24 -0500 Received: from localhost (localhost [127.0.0.1]) by filtteri5.pp.htv.fi (Postfix) with ESMTP id DDC125A723B; Thu, 12 Dec 2013 23:12:21 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at pp.htv.fi Received: from smtp5.welho.com ([213.243.153.39]) by localhost (filtteri5.pp.htv.fi [213.243.153.188]) (amavisd-new, port 10024) with ESMTP id 5V+QWN2vgdoc; Thu, 12 Dec 2013 23:12:16 +0200 (EET) Received: from blackmetal.bb.dnainternet.fi (91-145-91-118.bb.dnainternet.fi [91.145.91.118]) by smtp5.welho.com (Postfix) with ESMTP id D2EB05BC002; Thu, 12 Dec 2013 23:12:17 +0200 (EET) From: Aaro Koskinen To: Vinod Koul , Dan Williams , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Aaro Koskinen Subject: [PATCH] dma: mv_xor: fix kernel crash on probe error Date: Thu, 12 Dec 2013 23:11:55 +0200 Message-Id: <1386882715-16433-1-git-send-email-aaro.koskinen@iki.fi> X-Mailer: git-send-email 1.8.5.1 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Jason Cooper --- 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; } }