From patchwork Wed Jul 19 22:16:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 9853299 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 EE541602C8 for ; Wed, 19 Jul 2017 22:17:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE7B3286F5 for ; Wed, 19 Jul 2017 22:17:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D301528718; Wed, 19 Jul 2017 22:17:11 +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 96209286F5 for ; Wed, 19 Jul 2017 22:17:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932414AbdGSWQ4 (ORCPT ); Wed, 19 Jul 2017 18:16:56 -0400 Received: from smtp11.smtpout.orange.fr ([80.12.242.133]:40221 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753467AbdGSWQz (ORCPT ); Wed, 19 Jul 2017 18:16:55 -0400 Received: from localhost.localdomain ([92.140.223.76]) by mwinf5d46 with ME id mmGr1v00K1fWvEc03mGrlb; Thu, 20 Jul 2017 00:16:54 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 20 Jul 2017 00:16:54 +0200 X-ME-IP: 92.140.223.76 From: Christophe JAILLET To: dan.j.williams@intel.com, vinod.koul@intel.com, dave.jiang@intel.com Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] dmaengine: ioatdma: Fix error handling path in 'ioat_dma_self_test()' Date: Thu, 20 Jul 2017 00:16:48 +0200 Message-Id: <20170719221648.30253-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.11.0 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 'memcmp' fails, free allocated resources as done in all other error handling paths. Signed-off-by: Christophe JAILLET Signed-off-by: Dave Jiang --- Please review carefully, this patch looks "too obvious" to me! --- 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 ed8ed1192775..948fc1f8fb5c 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: