From patchwork Sun Mar 21 09:28:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 48222 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id D96D4B7CF0 for ; Sun, 21 Mar 2010 20:28:38 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752152Ab0CUJ2c (ORCPT ); Sun, 21 Mar 2010 05:28:32 -0400 Received: from mail-bw0-f211.google.com ([209.85.218.211]:53744 "EHLO mail-bw0-f211.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751883Ab0CUJ2a (ORCPT ); Sun, 21 Mar 2010 05:28:30 -0400 Received: by bwz3 with SMTP id 3so4380822bwz.29 for ; Sun, 21 Mar 2010 02:28:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=SejzlWDt0Ah3/Kb2yDXYDEPT7xI0571oKukQLrVGxNY=; b=SZ+JpKrDcXO8TyvDJVxzxIGhQGuNIkv82xC4lDyruHBgONTVS5FYQjzcPyNTnLl60n 046jWQhPPfzyiaQJFnpkZlHvTd0axsxoWH9r/GDxZ//G08XNXmBFJCo98hv4TiNFIyaI IHwc9Y3VIE+5bqxbBY7DdbNhVC/o8kiK1kwK0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=dYfAckIQuWH6w5L9c4ZujZmEaJ9wfzx7Ki8PCySa2z452IRsTI554F8FzN8gX41tji Q7d2assjf0NwTfJkYymY7HkNMdTbFF9A+PQfo8miqFll2NZPp6Hk2t7728blZ8f5qQyJ Mbb6wTnlrhVutFXemhcunZVweo49Yegm22ew4= Received: by 10.204.30.195 with SMTP id v3mr2219502bkc.3.1269163708660; Sun, 21 Mar 2010 02:28:28 -0700 (PDT) Received: from bicker ([196.43.68.90]) by mx.google.com with ESMTPS id g18sm13697013bkw.13.2010.03.21.02.28.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 21 Mar 2010 02:28:28 -0700 (PDT) Date: Sun, 21 Mar 2010 12:28:18 +0300 From: Dan Carpenter To: Trond Myklebust Cc: "J. Bruce Fields" , Neil Brown , "David S. Miller" , linux-nfs@vger.kernel.org, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] sunrpc: handle allocation errors from __rpc_lookup_create() Message-ID: <20100321092818.GI5331@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org __rpc_lookup_create() can return ERR_PTR(-ENOMEM). Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 8d63f8f..20e30c6 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c @@ -587,6 +587,8 @@ static struct dentry *__rpc_lookup_create_exclusive(struct dentry *parent, struct dentry *dentry; dentry = __rpc_lookup_create(parent, name); + if (IS_ERR(dentry)) + return dentry; if (dentry->d_inode == NULL) return dentry; dput(dentry);