From patchwork Fri Apr 2 07:27:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengguang Wu X-Patchwork-Id: 90335 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o327SLUB007459 for ; Fri, 2 Apr 2010 07:28:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932221Ab0DBH2M (ORCPT ); Fri, 2 Apr 2010 03:28:12 -0400 Received: from mga09.intel.com ([134.134.136.24]:39778 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932173Ab0DBH2J (ORCPT ); Fri, 2 Apr 2010 03:28:09 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 02 Apr 2010 00:27:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.51,352,1267430400"; d="scan'208";a="505779870" Received: from wfg-t61.sh.intel.com (HELO localhost.localdomain) ([10.239.21.191]) by orsmga002.jf.intel.com with ESMTP; 02 Apr 2010 00:27:49 -0700 Received: from wfg by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1NxbIE-00060M-7N; Fri, 02 Apr 2010 15:27:50 +0800 Date: Fri, 2 Apr 2010 15:27:50 +0800 From: Wu Fengguang To: Andrew Morton , stable@kernel.org Cc: "Yan, Zheng " , "linux-btrfs@vger.kernel.org" , "kirill@shutemov.name" , LKML , Jens Axboe Subject: [PATCH][BUGFIX] readahead: fix NULL filp dereference Message-ID: <20100402072750.GA22952@localhost> References: <3d0408631003252040r70c54b2fm24d64b819c59c9c@mail.gmail.com> <20100326040114.GA20717@localhost> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100326040114.GA20717@localhost> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 02 Apr 2010 07:28:40 +0000 (UTC) --- sound-2.6.orig/mm/readahead.c 2010-03-26 11:51:57.000000000 +0800 +++ sound-2.6/mm/readahead.c 2010-03-26 11:52:11.000000000 +0800 @@ -502,7 +502,7 @@ void page_cache_sync_readahead(struct ad return; /* be dumb */ - if (filp->f_mode & FMODE_RANDOM) { + if (filp && (filp->f_mode & FMODE_RANDOM)) { force_page_cache_readahead(mapping, filp, offset, req_size); return; }