Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756196AbZCTNJW (ORCPT ); Fri, 20 Mar 2009 09:09:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753070AbZCTNJI (ORCPT ); Fri, 20 Mar 2009 09:09:08 -0400 Received: from mx2.redhat.com ([66.187.237.31]:45548 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752325AbZCTNJH (ORCPT ); Fri, 20 Mar 2009 09:09:07 -0400 Date: Fri, 20 Mar 2009 10:08:39 -0300 From: Arnaldo Carvalho de Melo To: Li Zefan Cc: Ingo Molnar , Jens Axboe , Steven Rostedt , Frederic Weisbecker , LKML Subject: Re: [PATCH 7/7] blktrace: avoid accessing NULL bdev->bd_disk Message-ID: <20090320130839.GM30407@ghostprotocols.net> References: <49C2F599.3060306@cn.fujitsu.com> <49C2F63C.2090107@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49C2F63C.2090107@cn.fujitsu.com> X-Url: http://oops.ghostprotocols.net:81/blog User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 739 Lines: 20 Em Fri, Mar 20, 2009 at 09:49:48AM +0800, Li Zefan escreveu: > bdev->bd_disk can be NULL, if the block device is not opened. > > Try this against an unmounted partition, and you'll see NULL dereference: > # echo 1 > /sys/block/sda/sda5/enable > > Signed-off-by: Li Zefan I guess this can be discounted on my block layer newbeeness 8) But as an extra check in non hot-paths are usually a good thing... Acked-by: Arnaldo Carvalho de Melo - Arnaldo -- 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/