From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753352Ab1KZQxh (ORCPT ); Sat, 26 Nov 2011 11:53:37 -0500 Received: from mga02.intel.com ([134.134.136.20]:37101 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752792Ab1KZQxf (ORCPT ); Sat, 26 Nov 2011 11:53:35 -0500 Message-Id: X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.67,352,1309762800"; d="scan'208";a="80048308" From: Chris Wilson Subject: Re: [PATCH] drm, i915: Fix memory leak in i915_gem_busy_ioctl(). To: Rakib Mullick Cc: Keith Packard , akpm@linux-foundation.org, dri-devel , linux-kernel@vger.kernel.org In-Reply-To: References: <1321382968.8791.4.camel@localhost.localdomain> <20111121162306.GB3807@phenom.ffwll.local> <868vn9ieey.fsf@sumi.keithp.com> Date: Sat, 26 Nov 2011 16:53:23 +0000 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 26 Nov 2011 22:29:12 +0600, Rakib Mullick wrote: > Yes, no real problem with current code. I was just thinking from code > cleanup's pov. Is BUG_ON really needed in i915_add_request() ? No, just documentation as a reminder that the request should be preallocated, ideally so that we can fail gracefully without touching hardware and leaving it in an inconsistent state wrt to our bookkeeping. (This is more apparent in the overlay code which could hang the chip/driver if we hit a malloc error too late.) The BUG_ON has certainly outlived its usefulness. -Chris -- Chris Wilson, Intel Open Source Technology Centre