From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08FA6C2D0DB for ; Fri, 24 Jan 2020 11:36:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CAA78214DB for ; Fri, 24 Jan 2020 11:36:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579865816; bh=BFvTo5ib+88QZ4+i3IbuWcI70HqA+S9+gl/ABkQJWRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=gQnh7hP1zwMDC5hzRdWZMG0sZG9CYCn1/CpeVf2NAUVWfe/jLOzJ1MNb5vrnDu9g/ Wp1hJU12c+Lgp9l+bD8Jr1nf2y9VHv2J2ojnyhDdVgM4hfFH13oJ6FmUqorQtHIMrd n5C1Xm94YkDT8FVt0fkJG+L9ultnDRP3UkokS7ck= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404954AbgAXLgz (ORCPT ); Fri, 24 Jan 2020 06:36:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:56978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391962AbgAXLgs (ORCPT ); Fri, 24 Jan 2020 06:36:48 -0500 Received: from localhost (ip-213-127-102-57.ip.prioritytelecom.net [213.127.102.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CCBE82075D; Fri, 24 Jan 2020 11:36:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579865807; bh=BFvTo5ib+88QZ4+i3IbuWcI70HqA+S9+gl/ABkQJWRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1NMP4LlABA1QJBy7MGVc1Mw3MkLnNsQSTK7gp4KY+tcFFzEMHkvwoaw60QTLBi6Qt y72xXOFNnyGpatgEAbpIbzp7ueULZigS0mGtGrM4O/5UmeRebchDgH37LVNG+621zf 5MqQfsZBpckCM4SXTUHWwdRi1aIrD7ZUl0Z5Om6U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chuhong Yuan , Vinod Koul , Sasha Levin Subject: [PATCH 4.19 631/639] dmaengine: ti: edma: fix missed failure handling Date: Fri, 24 Jan 2020 10:33:21 +0100 Message-Id: <20200124093208.686655228@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124093047.008739095@linuxfoundation.org> References: <20200124093047.008739095@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chuhong Yuan [ Upstream commit 340049d453682a9fe8d91fe794dd091730f4bb25 ] When devm_kcalloc fails, it forgets to call edma_free_slot. Replace direct return with failure handler to fix it. Fixes: 1be5336bc7ba ("dmaengine: edma: New device tree binding") Signed-off-by: Chuhong Yuan Link: https://lore.kernel.org/r/20191118073802.28424-1-hslester96@gmail.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/ti/edma.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c index 982631d4e1f8a..44158fa859737 100644 --- a/drivers/dma/ti/edma.c +++ b/drivers/dma/ti/edma.c @@ -2345,8 +2345,10 @@ static int edma_probe(struct platform_device *pdev) ecc->tc_list = devm_kcalloc(dev, ecc->num_tc, sizeof(*ecc->tc_list), GFP_KERNEL); - if (!ecc->tc_list) - return -ENOMEM; + if (!ecc->tc_list) { + ret = -ENOMEM; + goto err_reg1; + } for (i = 0;; i++) { ret = of_parse_phandle_with_fixed_args(node, "ti,tptcs", -- 2.20.1