From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH] fs: check f_op before dereference its field Date: Thu, 24 Jan 2013 15:28:39 +0000 Message-ID: <20130124152839.GB4503@ZenIV.linux.org.uk> References: <1359039200-6232-1-git-send-email-jiang.xx.fang@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Jiang Fang Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:44105 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752380Ab3AXP2k (ORCPT ); Thu, 24 Jan 2013 10:28:40 -0500 Content-Disposition: inline In-Reply-To: <1359039200-6232-1-git-send-email-jiang.xx.fang@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Jan 24, 2013 at 10:53:20PM +0800, Jiang Fang wrote: > I don't know whether we can have NULL f_op today, but a quick > grep of '!file->f_op->' in fs directory shows most of times we > do the check. So fix the missing one. We should remove the bogus ones, actually, and hunt down the remaining few places that set ->f_op to NULL (AFAICS, all of them in dvb and in ->release() instances, at that; note that no methods can be ever called after ->release(), so these assignments are pointless _and_ irrelevant for any call sites of the methods).