From patchwork Mon May 18 11:34:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bob Copeland X-Patchwork-Id: 6428381 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 806D39F1CC for ; Mon, 18 May 2015 11:37:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 965FC205EF for ; Mon, 18 May 2015 11:37:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8B82C205EB for ; Mon, 18 May 2015 11:37:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753806AbbERLhc (ORCPT ); Mon, 18 May 2015 07:37:32 -0400 Received: from mail-ig0-f175.google.com ([209.85.213.175]:38770 "EHLO mail-ig0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753768AbbERLha (ORCPT ); Mon, 18 May 2015 07:37:30 -0400 Received: by igcau1 with SMTP id au1so44724347igc.1 for ; Mon, 18 May 2015 04:37:29 -0700 (PDT) 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:in-reply-to :references; bh=qMSQJ4l9/G55nrGi8uyTBcsV40zT8MMYFIr/r8m4MR0=; b=CT0hZLDzEYzpkfiKCz0iVTYBl2KfFm+Jer9TxNJ/etvSBZJKy6idRTxm4Swdo9M23t YTNrIDjyHxEbzuwc7BqdXn6FzND2aCT7Wu5fdGNClb/ScbHOD0HmT/7DJRjkkFrxW4Sp Ek6bjD2INUrP7zMvqE6+fkijXSjsgZOMw7tmw3LR+G+O0CFGiwyVPuWNe8lr1vUPqDk2 D4CUqmS3B0X3xiC1Cdq+/nxO0uw2QlwJZ7ruimyu7NT+CxQ5Kb+37iA3Y+Wlo9cJLzii KUbn0PKMz3AenVOsQMU9gAR9oVqwLkNSfKfkFJ1Dv6Z/TpkT52TGHfQ75RpLtCIDkWgm U5Yw== X-Gm-Message-State: ALoCoQkFwexiI3ySgZrMJswK4hXppW3j9E+jBzfm0Y4mk+u8NMdeeY4jXeMVOJ0T+94rYDRDYfS1 X-Received: by 10.50.73.198 with SMTP id n6mr13711049igv.32.1431949049608; Mon, 18 May 2015 04:37:29 -0700 (PDT) Received: from hash ([2001:470:1d:6db:230:48ff:fe9d:9c89]) by mx.google.com with ESMTPSA id a139sm7505833ioa.14.2015.05.18.04.37.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 May 2015 04:37:28 -0700 (PDT) Received: from glass.lan ([192.168.1.51] helo=glass) by hash with esmtp (Exim 4.84) (envelope-from ) id 1YuJMH-0005d9-FC; Mon, 18 May 2015 07:37:21 -0400 Received: from bob by glass with local (Exim 4.84) (envelope-from ) id 1YuJKE-0000zV-4O; Mon, 18 May 2015 07:35:14 -0400 From: Bob Copeland To: akpm@linux-foundation.org Cc: linux-fsdevel@vger.kernel.org, Bob Copeland Subject: [PATCH 2/4] omfs: set error return when d_make_root() fails Date: Mon, 18 May 2015 07:34:36 -0400 Message-Id: <1431948878-3756-3-git-send-email-me@bobcopeland.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1431948878-3756-1-git-send-email-me@bobcopeland.com> References: <1431948878-3756-1-git-send-email-me@bobcopeland.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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=ham 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 A static checker found the following issue in the error path for omfs_fill_super: fs/omfs/inode.c:552 omfs_fill_super() warn: missing error code here? 'd_make_root()' failed. 'ret' = '0' Fix by returning -ENOMEM in this case. Reported-by: Dan Carpenter Signed-off-by: Bob Copeland --- fs/omfs/inode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index 70d4191cf33d..6ce542c11f98 100644 --- a/fs/omfs/inode.c +++ b/fs/omfs/inode.c @@ -549,8 +549,10 @@ static int omfs_fill_super(struct super_block *sb, void *data, int silent) } sb->s_root = d_make_root(root); - if (!sb->s_root) + if (!sb->s_root) { + ret = -ENOMEM; goto out_brelse_bh2; + } printk(KERN_DEBUG "omfs: Mounted volume %s\n", omfs_rb->r_name); ret = 0;