From patchwork Tue May 16 14:22:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9729253 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 5C3A860386 for ; Tue, 16 May 2017 14:23:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E37C28A1E for ; Tue, 16 May 2017 14:23:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42D6D28A29; Tue, 16 May 2017 14:23:07 +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.4 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C95A828A1E for ; Tue, 16 May 2017 14:23:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1dAdNQ-0006GS-1X; Tue, 16 May 2017 14:23:04 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1dAdNO-0006GK-QV for v9fs-developer@lists.sourceforge.net; Tue, 16 May 2017 14:23:02 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.192.196 as permitted sender) client-ip=209.85.192.196; envelope-from=weiyj.lk@gmail.com; helo=mail-pf0-f196.google.com; Received: from mail-pf0-f196.google.com ([209.85.192.196]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) id 1dAdNM-0001z0-34 for v9fs-developer@lists.sourceforge.net; Tue, 16 May 2017 14:23:02 +0000 Received: by mail-pf0-f196.google.com with SMTP id u26so20121460pfd.2 for ; Tue, 16 May 2017 07:23:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Tqj+aEQwAM+i/DIABwGaoTS78AdrZSaKQktl9MU9nus=; b=V9FsOXWP28G3SVs7L0TmzR+zEUwv4+p6c+czyRQ08a/dGDX/ocYtbwZpWd0h7Jkya+ Oqdbo2hceqz20KRDrTLvlWB/qLD65jl/msgrMtvm8F7RGt4Ebv0CM6rwYpQ3pAXMkA3K H5+8fX0POoj0x3rlMy4aod9u4lkJeYzFeadpDfLiFzE+7lxIxSIgNTYRJrKMXiSlfCLw SFqvWoyph7ekrIYEjMmz1+uz69fBpNX6jeVm76FZYrsDLZuSbE3xY9332wMCr4ygVov5 C+TGnbiYFVwDiIXUjNH1N6F3kyA3safjI1xe5aM7SPh0l40XOaZQ8arC0jPrDTnxJK2t /cCw== X-Gm-Message-State: AODbwcD4M9pmUqf+EWUdtJpk+nDTpFyKkwfccml89g2g41FY5V7iUTpA gQ6PzBbuq3b8AQ== X-Received: by 10.98.158.136 with SMTP id f8mr12398555pfk.90.1494944574322; Tue, 16 May 2017 07:22:54 -0700 (PDT) Received: from 192.168.0.37 (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id l198sm22286046pga.50.2017.05.16.07.22.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 May 2017 07:22:53 -0700 (PDT) From: Wei Yongjun To: Eric Van Hensbergen , Ron Minnich , Latchesar Ionkov , Stefano Stabellini , Juergen Gross Date: Tue, 16 May 2017 14:22:47 +0000 Message-Id: <20170516142247.12301-1-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-Headers-End: 1dAdNM-0001z0-34 Cc: v9fs-developer@lists.sourceforge.net, Wei Yongjun , netdev@vger.kernel.org Subject: [V9fs-developer] [PATCH] xen/9pfs: fix return value check in xen_9pfs_front_probe() X-BeenThere: v9fs-developer@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: v9fs-developer-bounces@lists.sourceforge.net X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function xenbus_read() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 71ebd71921e4 ("xen/9pfs: connect to the backend") Signed-off-by: Wei Yongjun Reviewed-by: Stefano Stabellini --- net/9p/trans_xen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c index 71e8564..83fe487 100644 --- a/net/9p/trans_xen.c +++ b/net/9p/trans_xen.c @@ -454,8 +454,8 @@ static int xen_9pfs_front_probe(struct xenbus_device *dev, goto error_xenbus; } priv->tag = xenbus_read(xbt, dev->nodename, "tag", NULL); - if (!priv->tag) { - ret = -EINVAL; + if (IS_ERR(priv->tag)) { + ret = PTR_ERR(priv->tag); goto error_xenbus; } ret = xenbus_transaction_end(xbt, 0);