From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Kees Cook , Tony Luck , HuKeping Subject: [PATCH 3.10 32/51] pstore: d_alloc_name() doesnt return an ERR_PTR Date: Tue, 3 Feb 2015 15:17:14 -0800 Message-Id: <20150203231725.576255421@linuxfoundation.org> In-Reply-To: <20150203231724.582537862@linuxfoundation.org> References: <20150203231724.582537862@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: 3.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter commit c39524e6744284452ef45480d3153bec28960c32 upstream. d_alloc_name() returns NULL on error. Also I changed the error code from -ENOSPC to -ENOMEM to reflect that we were short on RAM not disk space. Signed-off-by: Dan Carpenter Acked-by: Kees Cook Signed-off-by: Tony Luck Cc: HuKeping Signed-off-by: Greg Kroah-Hartman --- fs/pstore/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -336,9 +336,8 @@ int pstore_mkfile(enum pstore_type_id ty mutex_lock(&root->d_inode->i_mutex); - rc = -ENOSPC; dentry = d_alloc_name(root, name); - if (IS_ERR(dentry)) + if (!dentry) goto fail_lockedalloc; memcpy(private->data, data, size);