From patchwork Fri Nov 17 21:37:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 10064059 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E3CD26037E for ; Fri, 17 Nov 2017 21:38:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D718C29FC3 for ; Fri, 17 Nov 2017 21:38:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB5EC2AE40; Fri, 17 Nov 2017 21:38:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC3C929FC3 for ; Fri, 17 Nov 2017 21:38:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936161AbdKQVi0 (ORCPT ); Fri, 17 Nov 2017 16:38:26 -0500 Received: from smtp04.smtpout.orange.fr ([80.12.242.126]:53730 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936157AbdKQViZ (ORCPT ); Fri, 17 Nov 2017 16:38:25 -0500 Received: from localhost.localdomain ([86.196.182.67]) by mwinf5d51 with ME id b9eF1w00X1TfVo6039eGvE; Fri, 17 Nov 2017 22:38:23 +0100 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 17 Nov 2017 22:38:23 +0100 X-ME-IP: 86.196.182.67 From: Christophe JAILLET To: dan.j.williams@intel.com, vinod.koul@intel.com, dave.jiang@intel.com, bianpan2016@163.com, arvind.yadav.cs@gmail.com, kjlx@templeofstupid.com, geliangtang@gmail.com Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] dmaengine: ioat: Fix error handling path Date: Fri, 17 Nov 2017 22:37:53 +0100 Message-Id: <20171117213753.21050-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.14.1 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the last test in 'ioat_dma_self_test()' fails, we must release all the allocated resources and not just part of them. Signed-off-by: Christophe JAILLET --- drivers/dma/ioat/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c index 2f31d3d0caa6..7792a9186f9c 100644 --- a/drivers/dma/ioat/init.c +++ b/drivers/dma/ioat/init.c @@ -390,7 +390,7 @@ static int ioat_dma_self_test(struct ioatdma_device *ioat_dma) if (memcmp(src, dest, IOAT_TEST_SIZE)) { dev_err(dev, "Self-test copy failed compare, disabling\n"); err = -ENODEV; - goto free_resources; + goto unmap_dma; } unmap_dma: