Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp759562ybk; Wed, 13 May 2020 12:18:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycUHzDYOOsj68PkrVNyAdiBBWCd4DtkMLEbQNqXatKcNx6Q7wtHc8nNSdI8qr/W8TkTR1W X-Received: by 2002:a17:906:3048:: with SMTP id d8mr494435ejd.97.1589397533609; Wed, 13 May 2020 12:18:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589397533; cv=none; d=google.com; s=arc-20160816; b=ZEdppPuOeXO3wQYmbFcp8rDyu2vZptqLfVFIsLQCtA8VInS+qORq3PLCWYRISeR889 hKL72hKAuntlHNnCNAXtiyvQ16m2BR51vhgUp09BXQNiZ2RFdvJ+3Xn77ioek4bKldeN mYFTgYKnupIMp2gz0WHwLwF9zVIckIcccgg098VZbHXvO7dxZ1cjubR9uIMmD2VAxIzB 9AhCnPrF5VaXGAvivMNx70kGWdLaqnGGxCdDqQNliVs7jA3CWm2OxB+IOLQzJcbYXe+E OjQpa4zXJdYPPGbVlEBhIPCyFeex4kYcLr4XKwM9dx/EcZh8Z7NQsZE4hV5OlVm12IlU dSQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=c4MBhFXOZtr5piYHjKdaYmafG5GWt17HP85GQ80yZ6A=; b=nPrryn1T46m/R2WE5pSkDlBHx9TVooVbSQruwB6A/tnFj/Mcfk5M3Qw2EufNDYp3wI P25PTGEjC1fa7M1l89ogtg/4dWlXjABaiN1gCKdhonRso3WDBsm828rJWb1VoRJM4OyR xunbiMkZbAsNZxU2qLptDV5Y7kP1LOOWcSo6b3ivQvKRuqjOEL64iiderPFLWo0j6qd5 91OqRmozpOqzy7t/1UaVH0k++7mG3s0A8yHRK9OEHGoqhPLz/BFEmoyCC1g2MX9h/A5b jNtVfJcLECgqwRomXeSQwFK6a3Glh6EwG30YQ1R8dzHUHBDXuD00g/344inWIEhPfqQC fcKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jfWQvgy9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z10si405065ejw.152.2020.05.13.12.18.30; Wed, 13 May 2020 12:18:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jfWQvgy9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390476AbgEMTOI (ORCPT + 99 others); Wed, 13 May 2020 15:14:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2387469AbgEMTOH (ORCPT ); Wed, 13 May 2020 15:14:07 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E374C061A0C; Wed, 13 May 2020 12:14:06 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id r22so156331pga.12; Wed, 13 May 2020 12:14:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=c4MBhFXOZtr5piYHjKdaYmafG5GWt17HP85GQ80yZ6A=; b=jfWQvgy9ENnwG5CcetrHoZhWpOg0qxn9CCtOg7/r5BIUuHmE9sjz1OGtTvOBNhVT82 f61YDuBaA+0tSxjOGTT5lQWaGu6Gqmvn41AKPHBTUVi3Pr93LuVOy254Uk0cLfetbZ9W t6bQFlh/BSDg2G9rRW1qdDV3/0HI+hQO9vLyfoWfZhYPoeXNpuEz2SxqwmH83rr32gjL UjeESdgKhtOuhMtyDhkq0GKsGo0wMBNBA0CpW8wrVqatmhwWCYOSwkFBEyyC7037WiEv 8Bd3PT1XiH+UhWaKzq1FfhGnocGZHQC49TIGtYAKZZn3qQR5cQvlDg4p+JSL+thHAc6t cW7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=c4MBhFXOZtr5piYHjKdaYmafG5GWt17HP85GQ80yZ6A=; b=j2Q3WtowwajRMGjenxzF/lSMUmKcLe9U5f2ZfF6sFTLaya3Y3zIIagnn3wGAGriNYx 6SOsD4qVhZdQdkAw3EjtlJaCqOjiyLgMQbo2ZtMtCMd5CqcXIRAh3NqW1uwAp09mEwj6 bxPjBgVNz/fZNa2VHFLhHbpcnRyE/eoUV2fv2yhhw2SjeqeikohSJwBM7lIgsBPPchAJ mTKN6GPsPgOkj/VbNaxapn9OLAf8tYe/sT71KlJpkDbLyBDXsPaUo/qgx0m1kz3+/cYt tbjXfgonKEyLZUmqbC68I7Gc01tR/1q9jxGh7CLaJnzdiWG3zg60IBhhXp0j+5dCmc5P nVdQ== X-Gm-Message-State: AOAM532VIl5oylgd5VU8lIV7BDji+3rEzhjN66nm+JdN8gXn/urgfQ1s CD6jwDWbkkPzz1p499LOPmX9O3D0 X-Received: by 2002:a63:c306:: with SMTP id c6mr729118pgd.311.1589397245758; Wed, 13 May 2020 12:14:05 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC.domain.name ([122.167.196.79]) by smtp.gmail.com with ESMTPSA id b16sm277986pfp.89.2020.05.13.12.14.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 May 2020 12:14:04 -0700 (PDT) From: Souptick Joarder To: hao.wu@intel.com, mdf@kernel.org Cc: linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, Souptick Joarder Subject: [PATCH] fpga: dfl: afu: Corrected error handling levels Date: Thu, 14 May 2020 00:52:05 +0530 Message-Id: <1589397725-29697-1-git-send-email-jrdr.linux@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Corrected error handling goto sequnece. Level put_pages should be called when pinned pages >= 0 && pinned != npages. Level free_pages should be called when pinned pages < 0. Signed-off-by: Souptick Joarder --- drivers/fpga/dfl-afu-dma-region.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/fpga/dfl-afu-dma-region.c b/drivers/fpga/dfl-afu-dma-region.c index 62f9244..5942343 100644 --- a/drivers/fpga/dfl-afu-dma-region.c +++ b/drivers/fpga/dfl-afu-dma-region.c @@ -61,10 +61,10 @@ static int afu_dma_pin_pages(struct dfl_feature_platform_data *pdata, region->pages); if (pinned < 0) { ret = pinned; - goto put_pages; + goto free_pages; } else if (pinned != npages) { ret = -EFAULT; - goto free_pages; + goto put_pages; } dev_dbg(dev, "%d pages pinned\n", pinned); -- 1.9.1