From patchwork Fri Dec 19 16:06:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 5520581 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4BDE6BEEA8 for ; Fri, 19 Dec 2014 16:06:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 64F9420142 for ; Fri, 19 Dec 2014 16:06:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8DB812013D for ; Fri, 19 Dec 2014 16:06:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751894AbaLSQGn (ORCPT ); Fri, 19 Dec 2014 11:06:43 -0500 Received: from cantor2.suse.de ([195.135.220.15]:43121 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751842AbaLSQGn (ORCPT ); Fri, 19 Dec 2014 11:06:43 -0500 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 147E3AC19 for ; Fri, 19 Dec 2014 16:06:42 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 9A5D0DAA27; Fri, 19 Dec 2014 17:06:41 +0100 (CET) From: David Sterba To: linux-btrfs@vger.kernel.org Cc: David Sterba Subject: [PATCH 6/6] btrfs-progs: let btrfs_free_path accept NULL Date: Fri, 19 Dec 2014 17:06:41 +0100 Message-Id: X-Mailer: git-send-email 2.1.3 In-Reply-To: References: Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Same in kernel and matches semantics of free(). Resolves-Coverity-CID: 1054881 Signed-off-by: David Sterba Reviewed-by: Eric Sandeen --- ctree.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ctree.c b/ctree.c index bd6cb125b2a2..589efa3db17e 100644 --- a/ctree.c +++ b/ctree.c @@ -48,6 +48,8 @@ struct btrfs_path *btrfs_alloc_path(void) void btrfs_free_path(struct btrfs_path *p) { + if (!p) + return; btrfs_release_path(p); kfree(p); }