From patchwork Sat Dec 10 13:47:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasanth KSR X-Patchwork-Id: 9469343 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 622AC60231 for ; Sat, 10 Dec 2016 13:49:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 525342856A for ; Sat, 10 Dec 2016 13:49:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46F05285A1; Sat, 10 Dec 2016 13:49:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF8502856A for ; Sat, 10 Dec 2016 13:49:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932247AbcLJNtC (ORCPT ); Sat, 10 Dec 2016 08:49:02 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:34298 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753471AbcLJNsS (ORCPT ); Sat, 10 Dec 2016 08:48:18 -0500 Received: by mail-pg0-f66.google.com with SMTP id e9so5376831pgc.1 for ; Sat, 10 Dec 2016 05:48:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=PnD5r6+HcdNg6WVkGQaTh6HT9BrV2qja8Kx+d4t95fs=; b=OUDEm6EexPJweoeWV+7NCj08YzR9OOgxrbjcfebtu6mL+BkAbg5Th8cI37qybD9tkz sEkIy1+yIZr+LsuW4TaJGYgW72DMs1VzBllrnUfxpH3zVdcqcxd+LOSmrbEZHFyUHjga cZSmj1KeTDCD0DTZZBliBxMMhR6a9oSA+lcQmQrZclTR3EDE1hC7QmPo416gRgPpTCBo h8M0F4SyBJCIzYWCG5QG6hhJ1j1gWRE7pSWU46VmgYcoBQVRDdG+9wRxpdzn2IY5TBcM ZCYbIGtmeyHQDAr2rQzgO+wJ7CLqGBriv1cut3YtAw2uSw8wkJ5+aquV+cKe+H4T1mk0 f/1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=PnD5r6+HcdNg6WVkGQaTh6HT9BrV2qja8Kx+d4t95fs=; b=eo07k+q9JpfjVAuEMwTldWlptoKt80VQOZvAAQHzGuNyGIkNdcSBdCqQwhEZcYbNtd bcRWSbyQ0SvTn7IjyRZHFV4zehD0+zPOzfOQzQlGmleyNlVOta5zUlX+mU1RW/shWcNu ofVA5p9q4wiB7wzLMaCsXxqJD+81FJW5VSLKDRl+iyGfe5Whou6hCUCx+fNbHsyWvHzX /C8CW7hGUx4Uf+ULmk7b/tKTIHXoNHQJHm+j99cI984SS1+BhKD2q/6o7dsdOxez4cLD HKjr0HJxT1wSJAwDIkUeX8l1M9SpZWW8kbkfnPE06Mk7ZprMtSUtb8XIgmt62xGoqJ6t /H8A== X-Gm-Message-State: AKaTC03qOuecY4+ur1cNSLTQHMDdgWzrBbRJ4X5Uw87P7m1bCr4cN73bafWbSl7ESIkHGA== X-Received: by 10.84.172.131 with SMTP id n3mr164315370plb.5.1481377698027; Sat, 10 Dec 2016 05:48:18 -0800 (PST) Received: from linux.local ([122.167.185.200]) by smtp.gmail.com with ESMTPSA id w17sm65166394pgm.18.2016.12.10.05.48.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 10 Dec 2016 05:48:17 -0800 (PST) From: Prasanth K S R To: linux-btrfs@vger.kernel.org Cc: Prasanth K S R , dsterba@suse.com Subject: [PATCH 1/3] Btrfs-progs: subvol_uuid_search: Return error on memory allocation failure Date: Sat, 10 Dec 2016 19:17:42 +0530 Message-Id: <20161210134744.10825-1-kosigiprasanth@gmail.com> X-Mailer: git-send-email 2.10.2 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Prasanth K S R This commit fixes coverity defect CID 1328695. Signed-off-by: Prasanth K S R --- send-utils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/send-utils.c b/send-utils.c index a85fa08..5026882 100644 --- a/send-utils.c +++ b/send-utils.c @@ -486,6 +486,10 @@ struct subvol_info *subvol_uuid_search(struct subvol_uuid_search *s, info->path = strdup(path); } else { info->path = malloc(PATH_MAX); + if (!info->path) { + ret = -ENOMEM; + goto out; + } ret = btrfs_subvolid_resolve(s->mnt_fd, info->path, PATH_MAX, root_id); }