Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp480570ybl; Tue, 28 Jan 2020 06:37:05 -0800 (PST) X-Google-Smtp-Source: APXvYqwZQrTSw+2ZFrgbkVzMFhSQC2LCR8b23AX8bmZ8rpF/1279a9VBSWpxVP3Ffpbst1D0F9gl X-Received: by 2002:aca:c786:: with SMTP id x128mr2905564oif.2.1580222224959; Tue, 28 Jan 2020 06:37:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580222224; cv=none; d=google.com; s=arc-20160816; b=uL9FTM4PC9tEoatBX7cMw0+Y7B9xobK848ez/aWUjqp+0yaLNvMv5m58WItc/Gipe9 TPiRTvG/cQt4g5LH3NhGbOh1EW3JsKoKYZ9DbtAGmfHzewQXvAUTstSSF4Q0ppjyvkbT RsoYdTPbvgMKTa1DUnG4INJPUxCOSCXILUszrvWRba8yRpo4n9P/samfiATF41iGErt9 5p91hdCcUSObXO/YkZ6StmIY8bhBhb66TFZbsfHtJgJa0rUL8rTl33nn8qiJpAzYUJiy l1s8O3YCy4zuBh5pTRJbS5Ma94+EJgEjb5ZHSi0ZE9hmjn3Rlu/F/Tk4vyLJ5WzgEIhq ZgBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XV/HaQgY5S4T1RVeqcrEEO3pBwz6U2Eh4zKgvTtdZuI=; b=GazOjNDwO7TyQ89ubOl39chsZc7dvR6/BGN+NDu4h4APAC02cR8J7TdfrxoBDe0USg A6BJJo0w22gdBXC5tWEhiQcvsR/1eTmmOY3MJgjWwLH0IsH1fFjWjl+j3dAivY3JQLEb C/cWb0VQqmo64hla5h0dMo3LB8gtJru/EXSmT0TVcojDFStZ0EG2qOp2SbxmMZrkL1Ox UCflHSxJXcksIREhye8efEyDlNmp6j/m/3A+9vteuwQcGMs9pBazc79ZJ4SedfVMJBrS CqTJVLcO3o8ptw+2x+vQTvUMZJ7kW8yBrhTIIOt7zga/7hAre5o3XsJQ1dLZLSFGVbCl EjQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IUPpaKTR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t1si7655229otq.148.2020.01.28.06.36.53; Tue, 28 Jan 2020 06:37:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IUPpaKTR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733222AbgA1OeP (ORCPT + 99 others); Tue, 28 Jan 2020 09:34:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:51046 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731008AbgA1OYX (ORCPT ); Tue, 28 Jan 2020 09:24:23 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 10B7B24686; Tue, 28 Jan 2020 14:24:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221462; bh=/yaIGJR8g7JpUUo36HIPU/CJouScglCaGh4k906XL64=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IUPpaKTRuiF1+402co8EgpnoTfHDKaJFnrqNpfFY+6X1vdXONUYV8Di131Qa5n/I9 M/OahVkpPdoz6skT2/nmjKvUQsD3Ry0HTiHYYjTTy2Z1iV5yqi7rSklcQZOFshsbgS PpRXUL+KsISxhWavFM2jLillvMe0ZwIQ1Jo29yXo= 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.9 227/271] dmaengine: ti: edma: fix missed failure handling Date: Tue, 28 Jan 2020 15:06:16 +0100 Message-Id: <20200128135909.474403550@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@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/edma.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c index 72f31e837b1d5..56ec724687456 100644 --- a/drivers/dma/edma.c +++ b/drivers/dma/edma.c @@ -2340,8 +2340,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