Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932406AbbGTOV0 (ORCPT ); Mon, 20 Jul 2015 10:21:26 -0400 Received: from mail-wg0-f53.google.com ([74.125.82.53]:33385 "EHLO mail-wg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932320AbbGTOVS (ORCPT ); Mon, 20 Jul 2015 10:21:18 -0400 Date: Mon, 20 Jul 2015 16:23:57 +0200 From: Daniel Vetter To: Sudip Mukherjee Cc: Chris Wilson , Daniel Vetter , Jani Nikula , David Airlie , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [Intel-gfx] [PATCH] drm/i915: fix possible null pointer dereference Message-ID: <20150720142357.GI16722@phenom.ffwll.local> Mail-Followup-To: Sudip Mukherjee , Chris Wilson , Daniel Vetter , Jani Nikula , David Airlie , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org References: <1437395369-749-1-git-send-email-sudipm.mukherjee@gmail.com> <20150720123846.GA6166@nuc-i3427.alporthouse.com> <20150720132831.GA1645@sudip-PC> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150720132831.GA1645@sudip-PC> X-Operating-System: Linux phenom 4.2.0-rc1+ User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1039 Lines: 24 On Mon, Jul 20, 2015 at 06:58:32PM +0530, Sudip Mukherjee wrote: > On Mon, Jul 20, 2015 at 01:38:46PM +0100, Chris Wilson wrote: > > On Mon, Jul 20, 2015 at 05:59:29PM +0530, Sudip Mukherjee wrote: > > > We were dereferencing dev first and then checking if it is NULL. Lets > > > check for NULL first and then dereference. > > > > The code is bonkers. Testing for a lack of a correctly constructed > > debugfs seq_file inside the debugfs seq_file callback is inane. > I missed seeing before sending this patch that there are some more > places where this has been done. > Then are you suggesting to remove the test? It's all been added for the tp validation support. And yes it should be removed everywhere. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch -- 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/