Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp700321ybp; Fri, 4 Oct 2019 03:38:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfUjn9oaxaRVzYO475pNwirE1zgvL9rdiLL+f9FkKSFDgz+ZeZOJ90HtHLKJAommSzKgGv X-Received: by 2002:a17:906:1c4e:: with SMTP id l14mr11779985ejg.276.1570185483845; Fri, 04 Oct 2019 03:38:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570185483; cv=none; d=google.com; s=arc-20160816; b=yB5WhVNgHwaMpcAl/l3hkJ5gm1ZCx/7bG/ILOXPT4m2Jlzj21YgqWbaE3Um1+Z/T2u di1BcONtIgw5pPRVc0B1Svqi/N/QjUCbEeePEuxu/H7A1BnKN4sR5VjgqdhGjS4cmwCj RVj4oH7y2nHQ0Vt/771lOdPIXqFCw/5y3MQaIG6EgoEPNtrsK/yXynIVRbrKT2Jp3aMY kLShgzaD0K9I97nNhCfxATFpE6fB7Vw24xfsOHxGrRIN+B1gnDCeUcMnveD1k3v3VPBv TFt0u4C7PUDxZ/X55hbRVXFmp0o4du+h6MCJ5SColXemHRR8YWJjeCKQ0g2LJ9X16Q6G SVqw== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=5Vcf+UVY2rqjJRPiANDeBRpXqOSdb6/jb+sfnhdp7MM=; b=hKrRw++Czjm+ECNhUhfZHiQ/pp9P52YjgzQLaiVNsMHYdG1a+Aedx8YF5V1ufrhWFm N9q+AnVSaUvd2UbYfYLgrjPT6ObbxS41eeET/6H9WR5Ra6gL4uztut+XFRlcATFCJ55P IFxmRYfJROYRfaNNsDmBWtt0xqbhCLo1HlS+mgvj+0IkPj+MEE48aJnPwoSj5IcMnAfN rUKa548adggjSud5KYg4ohbOsnbA3T69bV0F1CzsmegCY3s8/fdGjBjZNAbvNgdDWrYw q30C/F7zQEdaWfgKPZplIC5aEjLWfKBEu7MNC2i489CHOktDbDd4KErSyHhDeoAYlc9j Vnog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vJpW+xhT; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b34si3634328edb.439.2019.10.04.03.37.39; Fri, 04 Oct 2019 03:38:03 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=vJpW+xhT; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388643AbfJDKR5 (ORCPT + 99 others); Fri, 4 Oct 2019 06:17:57 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:51426 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388630AbfJDKR5 (ORCPT ); Fri, 4 Oct 2019 06:17:57 -0400 Received: by mail-wm1-f67.google.com with SMTP id 7so5229080wme.1 for ; Fri, 04 Oct 2019 03:17:54 -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:mime-version :content-transfer-encoding; bh=5Vcf+UVY2rqjJRPiANDeBRpXqOSdb6/jb+sfnhdp7MM=; b=vJpW+xhTbLcgoLYjISojp3oyFM70IqtJPOBBYFcbZkhWynU5Z8bYhxHuN7YednMisa 64/5PGDK2NwVv58w7wEsVJGBRp8laLhuJYKH2nt+XqCq3wUhz2H/OLJndPRKfsSQuPDd UcntM3z55GL+5uq6zUXU8jJoSpiE30YqO0ZKM7OqWmjjUAeaPM1NDym8yrA7sDqV5iPW FwjWE5AXVOY96r7uZiBk2d++9CiPErENN8vW7L7HEb9z30mUzpJ4lgSaBoj5Kb0a5g1u KxccvAuu0IsMCrV55yKKERr53DTtwpTgijWlFx/ViRu+WKjMyjgJMTrtRYOCrqVDRRxT ORew== 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:mime-version :content-transfer-encoding; bh=5Vcf+UVY2rqjJRPiANDeBRpXqOSdb6/jb+sfnhdp7MM=; b=RYFx7HPLm0Z7hXb/IBHOgtdtzoIwFGEOBJ8Zyvp+1+Xp6GjGbIm7tWVnCZ/Y/e31fz 2PvM72w9Z5jWaz6/TNpYUuXML98OXSUm+XKqoULo4+1wLC/o8oJ7unh5ccyP/12MtzAH aK6COJIB6aToBSBr9tEcpNFU3Dp4V79CspaF+gd8zk/mbc/7nYtUH+Amt5se2JtZD5EY TCLySXJaq2Knpvt2k7ZEuXJAws01OCEhb6vYQ5Xlwj8NJOIrsECHGhDZZJZYoKSKfgmQ iwtQxrNDmhNw6gD/mAYhdIRnVcvymvJjN70IF9KsPRa8kI1sGx6fREelQQ/ElRXuSoio D2pw== X-Gm-Message-State: APjAAAXeEcjxG5RCeYJvfN/mVjeHWC579HviCS91VIrrPkaSTvaBMNwD 7lnXlC5eqxyvF37QW6apZ8o= X-Received: by 2002:a7b:caaa:: with SMTP id r10mr10829469wml.100.1570184274042; Fri, 04 Oct 2019 03:17:54 -0700 (PDT) Received: from brihaspati.fritz.box (p5DE53CC9.dip0.t-ipconnect.de. [93.229.60.201]) by smtp.gmail.com with ESMTPSA id t18sm5278823wmi.44.2019.10.04.03.17.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2019 03:17:53 -0700 (PDT) From: Nirmoy Das X-Google-Original-From: Nirmoy Das To: alexander.deucher@amd.com, christian.koenig@amd.com Cc: airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, nirmoy.das@amd.com Subject: [PATCH] drm/amdgpu: fix memory leak Date: Fri, 4 Oct 2019 12:17:46 +0200 Message-Id: <20191004101746.19574-1-nirmoy.das@amd.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In amdgpu_bo_list_ioctl when idr_alloc fails don't return without freeing bo list entry. Fixes: 964d0fbf6301d ("drm/amdgpu: Allow to create BO lists in CS ioctl v3") Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c index 7bcf86c61999..c3e5ea544857 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c @@ -284,7 +284,7 @@ int amdgpu_bo_list_ioctl(struct drm_device *dev, void *data, mutex_unlock(&fpriv->bo_list_lock); if (r < 0) { amdgpu_bo_list_put(list); - return r; + goto error_free; } handle = r; -- 2.23.0