Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp23979lql; Fri, 12 Apr 2024 02:22:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXHLlXIEEXGroup2gc8EokKhHQOijtLeS57sgKfbafDot0uVQkKAM5vNCOu/GkKLNMqrqkzZTR1AeegdROBFyoG32KWNM8KAXCbtYJbIQ== X-Google-Smtp-Source: AGHT+IGVpj92Q8fHlNrd7oYGQY1kcF4RFtb5nOJClIh97FB2zewNVyMmyGXhUoh67xVFjJLzxD4x X-Received: by 2002:a50:d5d4:0:b0:56e:2a7d:827c with SMTP id g20-20020a50d5d4000000b0056e2a7d827cmr1347779edj.18.1712913755556; Fri, 12 Apr 2024 02:22:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712913755; cv=pass; d=google.com; s=arc-20160816; b=XR+GlwxNCMr/SJMpMBIPCnFb8fY0Ix1bSsN6JGtqe/7o+bIAxn2xGSWseAg0a7UBC5 r6HxZ+bwyKFKzy2L5P09qvLja2ko8z+RzUsLy4H42lzHVRrE9oQLOZZnhdcJ40ywOqwY xN94Pvz95oTgE5AP3IbmZbj8mQDTG0kZePZW3vtpvkZURHGKozOzR57K909wzsde55WN MMPW6qm4sPjK0/z3dOV3BAOagXoejqo3w6ePljL2k+PIA79iCL1fT02JIrGnyRG3S5fS VXQ1bJYB10eDTVPtRkK5iKp1C5t1t0UNP15H/RAmHal2m54BQMa2GnNugGvK03AJtLzS yTAA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=ZnjyUDh75ceN34Ga9gwSHzjcOzW4RKZy00qSOYkN3bw=; fh=KWvyQxL3Ff+3WPSMjlYu+P4255AmcMULAsFol6M1vNI=; b=VjMFKfMROwQSboJ6Fm0diKenW5wIvlUpvvxYUNlOYyoSBw2djnJGXuthJyk8CCQ4kv XO4VOAsZIb7hQsJVYobuzCkdQU/MdS0A+2mZ5NH431LasZu7+g3lSzb8DDA3ZrFutYxs FwVuNIvHl7yPAcBgWWVYTfIT5Y466BByQKiXv53RjgJNkLaSOduJmXV86wVmT1AoWfiJ BEeP00Fht+dL3mOG0Np4Wel1TdgcZycN6eN+WdCNKoXN6alZBUPdlnZ3WKIy9ieX5JcG JRZAy0UgeW6JFr4Gv3s++T5zAa3VrH02hmNzVCWcY8KQOjrKDmn5q/BuePIvbb7wPT6z O9rw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=hisilicon.com dmarc=pass fromdomain=hisilicon.com); spf=pass (google.com: domain of linux-kernel+bounces-142390-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142390-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ev27-20020a056402541b00b0056fe5a776easi1492439edb.417.2024.04.12.02.22.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 02:22:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142390-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=hisilicon.com dmarc=pass fromdomain=hisilicon.com); spf=pass (google.com: domain of linux-kernel+bounces-142390-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142390-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2FA6D1F23018 for ; Fri, 12 Apr 2024 09:22:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C4FD5646D; Fri, 12 Apr 2024 09:20:55 +0000 (UTC) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FADD51C28; Fri, 12 Apr 2024 09:20:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.255 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712913653; cv=none; b=nVESPfS2cZJUNNETZWNOOWyD6yoHQ6tNZc3vF/LAQxyzW7mkhLuSfd7fh32xYOxf3+rSe7Vvm3PagKaWIW5/Xj9ztRNjedzR4JCKH0cQIzPhD7AlGajmBgguFiH3Tscn/vbzVpC6WEEbDx0nD6P9m0gOquyWAieMrjZMi2Xdb5Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712913653; c=relaxed/simple; bh=+ivkiaHwYR9kCtG2xAgJfRYRsWVeHxNmNa7IDEZIRTU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=c+IOYIeFw41Jn6d6o3zETeIYrRoMmtavusHV07sf8hwuqUCUTe9MpQ9/CyY+Wz1Fph0QKgRSV7UJtGM+sZSJDlnhfC4dxFv+B9EoTARjsIue+iEy6PMyvmkfKKxWugtVu+E1hLGnjXNvaWSqbPp1U1KXVsd9QH9V1uPeaIs9aSw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=hisilicon.com; spf=pass smtp.mailfrom=hisilicon.com; arc=none smtp.client-ip=45.249.212.255 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=hisilicon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hisilicon.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4VG9vv2zv8z1R5mb; Fri, 12 Apr 2024 17:18:03 +0800 (CST) Received: from kwepemi500006.china.huawei.com (unknown [7.221.188.68]) by mail.maildlp.com (Postfix) with ESMTPS id 31E2818006B; Fri, 12 Apr 2024 17:20:49 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemi500006.china.huawei.com (7.221.188.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 12 Apr 2024 17:20:48 +0800 From: Junxian Huang To: , CC: , , , Subject: [PATCH for-next 06/10] RDMA/hns: Fix mismatch exception rollback Date: Fri, 12 Apr 2024 17:16:12 +0800 Message-ID: <20240412091616.370789-7-huangjunxian6@hisilicon.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240412091616.370789-1-huangjunxian6@hisilicon.com> References: <20240412091616.370789-1-huangjunxian6@hisilicon.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500006.china.huawei.com (7.221.188.68) From: wenglianfa When dma_alloc_coherent() fails in hns_roce_alloc_hem(), just call kfree() to release hem instead of hns_roce_free_hem(). Fixes: c00743cbf2b8 ("RDMA/hns: Simplify 'struct hns_roce_hem' allocation") Signed-off-by: wenglianfa Signed-off-by: Junxian Huang --- drivers/infiniband/hw/hns/hns_roce_hem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_hem.c b/drivers/infiniband/hw/hns/hns_roce_hem.c index a9ea55506779..1c2ec803e030 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hem.c +++ b/drivers/infiniband/hw/hns/hns_roce_hem.c @@ -281,7 +281,7 @@ static struct hns_roce_hem *hns_roce_alloc_hem(struct hns_roce_dev *hr_dev, return hem; fail: - hns_roce_free_hem(hr_dev, hem); + kfree(hem); return NULL; } -- 2.30.0