Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753063AbbD0PhA (ORCPT ); Mon, 27 Apr 2015 11:37:00 -0400 Received: from linuxhacker.ru ([217.76.32.60]:38248 "EHLO fiona.linuxhacker.ru" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1753022AbbD0Pg6 (ORCPT ); Mon, 27 Apr 2015 11:36:58 -0400 Subject: Re: [PATCH 2/2] drm: fix a memleak on mutex failure path Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Oleg Drokin In-Reply-To: <87d22qc5lr.fsf@intel.com> Date: Mon, 27 Apr 2015 11:36:33 -0400 Cc: David Airlie , dri-devel@lists.freedesktop.org, Daniel Vetter , "" , open list Content-Transfer-Encoding: 7bit Message-Id: References: <1430025269-26243-1-git-send-email-green@linuxhacker.ru> <1430025269-26243-3-git-send-email-green@linuxhacker.ru> <87d22qc5lr.fsf@intel.com> To: Jani Nikula X-Mailer: Apple Mail (2.1283) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1157 Lines: 35 Hello! On Apr 27, 2015, at 4:56 AM, Jani Nikula wrote: > On Sun, 26 Apr 2015, green@linuxhacker.ru wrote: >> From: Oleg Drokin >> >> Need to free just allocated ctx allocation if we cannot >> get our config mutex. >> >> This one has been flagged by kbuild bot all the way back in August, >> but somehow nobody picked it up: >> https://lists.01.org/pipermail/kbuild/2014-August/001691.html >> >> Found with smatch. >> >> Signed-off-by: Oleg Drokin >> CC: Daniel Vetter > > The function has another leaking failure path, would be nice to have > that fixed too. Maybe with a common out label. Hm, you are right, there's another path, though it's less obvious since what is done with ctx inside of those other calls, but apparently nothing if there is an error, so it's also a leak. I'll do an updated patch in a moment. Bye, Oleg -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/