From patchwork Tue Nov 10 09:01:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 58976 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAA920vT030686 for ; Tue, 10 Nov 2009 09:02:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752874AbZKJJBw (ORCPT ); Tue, 10 Nov 2009 04:01:52 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753160AbZKJJBw (ORCPT ); Tue, 10 Nov 2009 04:01:52 -0500 Received: from mail-ew0-f207.google.com ([209.85.219.207]:56141 "EHLO mail-ew0-f207.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752874AbZKJJBw (ORCPT ); Tue, 10 Nov 2009 04:01:52 -0500 Received: by ewy3 with SMTP id 3so4000855ewy.37 for ; Tue, 10 Nov 2009 01:01:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-x-sender:to:cc :subject:message-id:user-agent:mime-version:content-type; bh=sQ+DhIRwbExvHmKuAuCrLJideb2FFIfiafeXERY8cJE=; b=HkLz6ST8dHz7nCr4C2KNx0ChsDOWU7arBp0FvGgRTqgEckk9QVpYHo0UXY3uawYNUR tmtPXhuVQo0l5OXri1/A8kiE3oEyAwj2Imu15vSbVEd2QylnmtHl5iP+/Ttcw6GD9ofB WmmJYnAxha1VpfITBZmAM79yEn0MqK3mcOsSQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-x-sender:to:cc:subject:message-id:user-agent :mime-version:content-type; b=VZ0Hp3KvcpnzYYdWnTJtq+1Rp3lTm3qcByp+wKSuMBI0IELJQVHRYfKfAVJ47b6CrW uMDEv5ryENKwOnpZs2nn7n3ZBzh7Q7xjpL0bsKAJpZNNPney4lYVkHEkpqs97RHiKB9S iUdSZJbYa8xpDev660lOFRJrXvdilv3auG2OM= Received: by 10.213.26.199 with SMTP id f7mr4659784ebc.72.1257843712307; Tue, 10 Nov 2009 01:01:52 -0800 (PST) Received: from bicker.local ([41.222.20.196]) by mx.google.com with ESMTPS id 7sm1243049eyb.16.2009.11.10.01.01.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 10 Nov 2009 01:01:51 -0800 (PST) Date: Tue, 10 Nov 2009 11:01:43 +0200 (SAST) From: Dan Carpenter X-X-Sender: dcarpenter@bicker To: chris.mason@oracle.com cc: linux-btrfs@vger.kernel.org Subject: [patch] avoid null deref in unpin_extent_cache() Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org --- orig/fs/btrfs/extent_map.c 2009-11-08 14:01:09.000000000 +0200 +++ devel/fs/btrfs/extent_map.c 2009-11-08 14:01:44.000000000 +0200 @@ -208,7 +208,7 @@ write_lock(&tree->lock); em = lookup_extent_mapping(tree, start, len); - WARN_ON(em->start != start || !em); + WARN_ON(!em || em->start != start); if (!em) goto out;