Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3598476ybc; Thu, 21 Nov 2019 10:40:04 -0800 (PST) X-Google-Smtp-Source: APXvYqygQ8rMlS5LK3U1pwLdC7oj1WxhXIxephHT6E5xXhyXHgpP3s8HBieXjKhIXZhTnIsj/IRp X-Received: by 2002:adf:ce05:: with SMTP id p5mr12868508wrn.48.1574361604744; Thu, 21 Nov 2019 10:40:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574361604; cv=none; d=google.com; s=arc-20160816; b=mNkTecqSCdDVJIuzgeIRQYz+7AbIqTu7Yb67E6m9LGQcN2/r0Jf1Ft5v+e0/I2P041 iEtATMziblQLNBC5BPoF84Sv0tPLqKvtlMZvtEqywwEqOkpmxMbiM+DmqfZdUdvwflpN yBnMGh90orL3fBZLBDAvYZO7YJxIvlRkzUFQ3bP1D2HHGMXnCn9CxllRUaSFoflqbvu/ voO93ALyEJ6QzVCyQvEfqomITuHG8CptvaS3DqRwB5759JyVPTVxu3gRh7bAuTeI5pfP 8E+4JVPwioUdX565VNgRQ8Wm+xO41P2vjfW5K2x24ElfEM7BfjQavMOVrzHfmIBAq2Ax PDWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=faq1HCiwAUKpn9KibrFveIIN8Gq95mpKVvXAdv0gtDk=; b=nc+WCwZOKM0MyayImY/NvR1hCYagitcdobPiHalYmYeWUyKJCmahaBiUkprchRsKs9 EbqaBxAruUqGpy7n17BjBzCHgmzap+UeazBfEEBP7Lx2jMvlWeFi2NEQgLXfAvdLW2kJ UoiJb6nUajG2SmR9QHQGp76RVtikzxjbv+j/KDpyXQox7+La3wQQdsiO0JO48ePm8Xr2 VDgy+GTj8+LGIvt/nwlnCKXR8cp+7DdbO9SWumfz55wpH/7Fr+zFUoH0kR8oP5ivj69k +IWoT+L+nafJ7nOLEDfXPZs5wdGjA6Bm+QlevlaUti0bgp9FUBW+LG2CCamaEVTNarbU P8Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=EJjPbSz0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id be7si2684990edb.438.2019.11.21.10.39.41; Thu, 21 Nov 2019 10:40:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=EJjPbSz0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727179AbfKUSha (ORCPT + 99 others); Thu, 21 Nov 2019 13:37:30 -0500 Received: from mail-il1-f193.google.com ([209.85.166.193]:40360 "EHLO mail-il1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727092AbfKUSh3 (ORCPT ); Thu, 21 Nov 2019 13:37:29 -0500 Received: by mail-il1-f193.google.com with SMTP id v17so412843ilg.7 for ; Thu, 21 Nov 2019 10:37:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=faq1HCiwAUKpn9KibrFveIIN8Gq95mpKVvXAdv0gtDk=; b=EJjPbSz0Y6tDOEGVI+1jJ8atWnfgVSawkkT8eN6V6cCPix2Oo1Ul5auUyUzMkYlDoK 3qNVcfI7jBdMccdBn/qZtJ6b635qSK6GyU075QBm/DiZL+E8zm9p4ZUKRL1MoOZVUo9N hoLYwkn2XLv87sQlikDmsBXss5UhTiaeuDHLmSWYC9JxUub0lmUUW2xZVXJnpyOXNaGw y82WJV8Pyc4iflpx/NYF12hA4nSerOKHfUJ23hnfkFrUUUVENyO4lqlRhEgEEDYvonHB 7Ro2z4dGPGwjzFmYorVFleDJuov531ZDGun6BqLfvQZGB8jgtd1IecdJaPKyCHOmApK5 PRKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=faq1HCiwAUKpn9KibrFveIIN8Gq95mpKVvXAdv0gtDk=; b=Xk0eWVXJdvF160xXbqGcgB19NjlAcQ3vXAc7mKI4tCdtGRnBbQIJGw5UxP/SW1IE4b G2wT/bC3EIj/dGBN3kW7fvJtRnyz/H2ceANbK0O7Mcco8R471nVzRDmEfZFpfNcVwSis aGdOje0OQ/uuAGgAAH62lX4jld1fB3bJsaFUN2j46spOBHiyCo1iWSV/ZIa5IeniIvgw VJZsjvjdR3gAanbP7zeVLKZv9JoGnEA9M3Fxr3SO0joydK/GR4CDvkPh33hGbT0wBAgC 7cVrdkZ2Tn+PGpZwg6/oGGeEUllmS+WLsb/u+lmucZrcPO0H3dEQ4VHJgwA4yPalr2t4 gX6A== X-Gm-Message-State: APjAAAVin7cRjCgaIQF6DB22LrK3XvVvx7u1DFW4tbL11+ZAJFfFOJg3 nBUQgnGkepOQodpFnMY7/6jPb0X1M5y2ng== X-Received: by 2002:a92:b686:: with SMTP id m6mr11013166ill.35.1574361446126; Thu, 21 Nov 2019 10:37:26 -0800 (PST) Received: from [192.168.1.159] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id s11sm1518746ilh.54.2019.11.21.10.37.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Nov 2019 10:37:25 -0800 (PST) Subject: Re: [PATCH] nbd: prevent memory leak To: Josef Bacik , Navid Emamdoost Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu, linux-block@vger.kernel.org, nbd@other.debian.org, linux-kernel@vger.kernel.org References: <20190923200959.29643-1-navid.emamdoost@gmail.com> <20191121183017.h3qkpib5re27ty3b@MacBook-Pro-91.local> From: Jens Axboe Message-ID: Date: Thu, 21 Nov 2019 11:37:23 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191121183017.h3qkpib5re27ty3b@MacBook-Pro-91.local> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/21/19 11:30 AM, Josef Bacik wrote: > On Mon, Sep 23, 2019 at 03:09:58PM -0500, Navid Emamdoost wrote: >> In nbd_add_socket when krealloc succeeds, if nsock's allocation fail the >> reallocted memory is leak. The correct behaviour should be assigning the >> reallocted memory to config->socks right after success. >> >> Signed-off-by: Navid Emamdoost >> --- > > Reviewed-by: Josef Bacik Now applied, thanks. -- Jens Axboe