Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755131AbbGTN2q (ORCPT ); Mon, 20 Jul 2015 09:28:46 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:33871 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754697AbbGTN2o (ORCPT ); Mon, 20 Jul 2015 09:28:44 -0400 Date: Mon, 20 Jul 2015 18:58:32 +0530 From: Sudip Mukherjee To: 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: [PATCH] drm/i915: fix possible null pointer dereference Message-ID: <20150720132831.GA1645@sudip-PC> References: <1437395369-749-1-git-send-email-sudipm.mukherjee@gmail.com> <20150720123846.GA6166@nuc-i3427.alporthouse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150720123846.GA6166@nuc-i3427.alporthouse.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 792 Lines: 18 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? regards sudip -- 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/