From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id D8DECA05D3 for ; Tue, 23 Apr 2019 22:16:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AAAF41B4C1; Tue, 23 Apr 2019 22:16:38 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40057.outbound.protection.outlook.com [40.107.4.57]) by dpdk.org (Postfix) with ESMTP id 0574C1B447 for ; Tue, 23 Apr 2019 22:16:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D2mTrtuSMzH0f5y+E5duyN+FOQ44+x4zFhP7+b46xhA=; b=VY3xnVEfJhDyT3INl3xecpkGTSLWa/Z1XfGSTWHfzskE7joVRoNYwqU/aBJ8iRonAgLtjPiGJVvuxkDsDYNyKEgx/+f4WHJfiiK3WmAdCHaGcbCRE4y7wbJioDl4bCPDWimQBDQaIePfW004t2VXrbP9dS8KzE33jeVEOCpF/6E= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB3993.eurprd05.prod.outlook.com (52.134.70.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.16; Tue, 23 Apr 2019 20:16:36 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::e8d5:4aff:902d:6e98]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::e8d5:4aff:902d:6e98%5]) with mapi id 15.20.1835.010; Tue, 23 Apr 2019 20:16:36 +0000 From: Yongseok Koh To: Herakliusz Lipiec CC: Matan Azrad , Shahaf Shuler , "dev@dpdk.org" Thread-Topic: [PATCH v2 7/8] ipc: fix net/mlx4 memleak Thread-Index: AQHU+fwWhNXgK/gdJ0645ms4CbTwo6ZKLu4A Date: Tue, 23 Apr 2019 20:16:36 +0000 Message-ID: <23BF2C9B-1603-4AD0-8BF5-EF4534C4941A@mellanox.com> References: <20190417143822.21276-1-herakliusz.lipiec@intel.com> <20190423174334.19612-1-herakliusz.lipiec@intel.com> <20190423174334.19612-8-herakliusz.lipiec@intel.com> In-Reply-To: <20190423174334.19612-8-herakliusz.lipiec@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-originating-ip: [69.181.245.183] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8983f9f7-92bd-43c0-63e9-08d6c8289672 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:DB3PR0502MB3993; x-ms-traffictypediagnostic: DB3PR0502MB3993: x-microsoft-antispam-prvs: x-forefront-prvs: 0016DEFF96 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(136003)(396003)(346002)(376002)(189003)(199004)(8936002)(256004)(25786009)(76176011)(97736004)(83716004)(66066001)(102836004)(26005)(53546011)(14454004)(14444005)(33656002)(7736002)(6506007)(229853002)(71190400001)(71200400001)(478600001)(6486002)(6436002)(68736007)(5660300002)(446003)(82746002)(11346002)(6512007)(305945005)(53936002)(91956017)(86362001)(64756008)(316002)(2906002)(36756003)(2616005)(8676002)(486006)(476003)(6916009)(4326008)(73956011)(99286004)(66946007)(66556008)(66446008)(66476007)(186003)(6246003)(6116002)(81156014)(76116006)(81166006)(54906003)(3846002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3993; H:DB3PR0502MB3980.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ppwQdEf2u5k5NHRwGWxYHvdMYLr84B4pqyI9rKB055LA6URReD6Ja3pUOpKzcK4LxTbf8Dsonr+rUsRaWINr3aG7Ic40aRZkSih/jEpchOvGJMel0jdzjk96ByMl5TIThPLhG+eOhmy10dUmD9culaMSE0BCYVmPnU1PTLGJaGenuL4AD6gFml/AUum/bPaDtXw15C4ieCt9DVB0rnlw+2CWDDIS5H1Vk8mDtPz6JQ9io4g461tqA+QcufJYNm05iDpnGHnxJQIyaaLtKuVmvSU4wnz3NOIRKXICWN35CEi7b+jtfHy4NcFcdG/G7SKJNLnke8WHbcn2e0PnQ/86gn3aHge7UiGTPaFKWqUHw6LfadU31Ww672FiD9XORzefbJNuiE59SeVHukf2SkcMReJfVQOJL2vq1lD4cA0saBw= Content-Type: text/plain; charset="UTF-8" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8983f9f7-92bd-43c0-63e9-08d6c8289672 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2019 20:16:36.6388 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3993 Subject: Re: [dpdk-dev] [PATCH v2 7/8] ipc: fix net/mlx4 memleak X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190423201636.guWreeGjXf-6lypMy2SylOWDdvANzFT3zS4hZA9Y5F8@z> > On Apr 23, 2019, at 10:43 AM, Herakliusz Lipiec wrote: >=20 > When sending synchronous IPC requests, the caller must free the response= =20 > buffer even if the request returned failure. Fix the code to correctly=20 > use the IPC API. >=20 > Bugzilla ID:228 > Fixes: 0b259b8e9655 ("net/mlx4: enable secondary process to register DMA = memory") > Cc: yskoh@mellanox.com > Signed-off-by: Herakliusz Lipiec > --- Acked-by: Yongseok Koh > drivers/net/mlx4/mlx4_mp.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/mlx4/mlx4_mp.c b/drivers/net/mlx4/mlx4_mp.c > index 183622453..f4cff7486 100644 > --- a/drivers/net/mlx4/mlx4_mp.c > +++ b/drivers/net/mlx4/mlx4_mp.c > @@ -255,6 +255,7 @@ mlx4_mp_req_mr_create(struct rte_eth_dev *dev, uintpt= r_t addr) > if (ret) { > ERROR("port %u request to primary process failed", > dev->data->port_id); > + free(mp_rep.msgs); > return -rte_errno; > } > assert(mp_rep.nb_received =3D=3D 1); > @@ -292,7 +293,8 @@ mlx4_mp_req_verbs_cmd_fd(struct rte_eth_dev *dev) > if (ret) { > ERROR("port %u request to primary process failed", > dev->data->port_id); > - return -rte_errno; > + ret =3D -rte_errno; > + goto exit; > } > assert(mp_rep.nb_received =3D=3D 1); > mp_res =3D &mp_rep.msgs[0]; > --=20 > 2.17.2 >=20