From patchwork Sat Dec 25 21:22:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Juhl X-Patchwork-Id: 432951 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBPLWb66032740 for ; Sat, 25 Dec 2010 21:32:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752261Ab0LYVcP (ORCPT ); Sat, 25 Dec 2010 16:32:15 -0500 Received: from swampdragon.chaosbits.net ([90.184.90.115]:16847 "EHLO swampdragon.chaosbits.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751660Ab0LYVcO (ORCPT ); Sat, 25 Dec 2010 16:32:14 -0500 Received: by swampdragon.chaosbits.net (Postfix, from userid 1000) id BE6499403F; Sat, 25 Dec 2010 22:22:30 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by swampdragon.chaosbits.net (Postfix) with ESMTP id AFF339403B; Sat, 25 Dec 2010 22:22:30 +0100 (CET) Date: Sat, 25 Dec 2010 22:22:30 +0100 (CET) From: Jesper Juhl To: linux-btrfs@vger.kernel.org cc: linux-kernel@vger.kernel.org, Chris Mason Subject: [PATCH] btrfs: Don't pass NULL ptr to func that may deref it. Message-ID: User-Agent: Alpine 2.00 (LNX 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sat, 25 Dec 2010 21:32:37 +0000 (UTC) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 9ac1715..99599f1 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -105,6 +105,8 @@ noinline void btrfs_clear_path_blocking(struct btrfs_path *p, /* this also releases the path */ void btrfs_free_path(struct btrfs_path *p) { + if (!p) + return; btrfs_release_path(NULL, p); kmem_cache_free(btrfs_path_cachep, p); }