From patchwork Wed Jul 12 07:25:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 9836023 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 E14DE602BD for ; Wed, 12 Jul 2017 07:27:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7E86284E3 for ; Wed, 12 Jul 2017 07:27:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB197285B5; Wed, 12 Jul 2017 07:27:47 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5032B284E3 for ; Wed, 12 Jul 2017 07:27:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dVC1S-0002vJ-Le; Wed, 12 Jul 2017 07:25:22 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dVC1Q-0002vD-WE for xen-devel@lists.xenproject.org; Wed, 12 Jul 2017 07:25:21 +0000 Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id 8D/1C-01712-0EEC5695; Wed, 12 Jul 2017 07:25:20 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrOIsWRWlGSWpSXmKPExsUyZ7p8oO79c6m RBscbNC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oy1h/axF0xlqei6OJ+1gfE8cxcjF4eQwEQm iQ8rfrJAOL8ZJZZ3bGDqYuQEcjYySrxcUQZh10t8mNDMDmKzCKhKHF/XxwJiswnoSTROOs0GY osIpEpc/PACrJdZIEfiy9P7YPXCAg4Se9Y1MILYvAImEts27YOyBSVOznzCAlGvJXHj30ugXg 4gW1pi+T8OkLAEUHjbf4hVogIqEp1L57BAxA0lPm9cyjyBUWAWkkmzkEyahTBpASPzKkaN4tS istQiXSMDvaSizPSMktzEzBxdQwNTvdzU4uLE9NScxKRiveT83E2MwOCsZ2Bg3MHYONvvEKMk B5OSKG/6htRIIb6k/JTKjMTijPii0pzU4kOMMhwcShK8684C5QSLUtNTK9Iyc4BxApOW4OBRE uGV2weU5i0uSMwtzkyHSJ1iNObYsHr9FyaOpg9bvjAJseTl56VKifOWgkwSACnNKM2DGwSL30 uMslLCvIwMDAxCPAWpRbmZJajyrxjFORiVhHkbzwBN4cnMK4Hb9wroFCagU9Zkp4CcUpKIkJJ qYCz/JdK59UroJs22OZ8OOuTfq2ew+6s8h3dTrZrgzAM97NrvWd0mxwjKpyip7bmy+WrKnwVX g35/nHKYJ/Dn7bsXE1LO/DrWqi5fc2XJ3mu2rvsEpr8vduXZHfEj7mLTe4tWJ5bnZTkTjJ228 NwR/9uS/tvZY+UEDbeQd4ummBhenHeGy+D+iywlluKMREMt5qLiRAClU2KS2gIAAA== X-Env-Sender: dan.carpenter@oracle.com X-Msg-Ref: server-14.tower-206.messagelabs.com!1499844317!63665272!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 29208 invoked from network); 12 Jul 2017 07:25:19 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 12 Jul 2017 07:25:19 -0000 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v6C7PEeD021871 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Jul 2017 07:25:15 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v6C7PElU029842 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Jul 2017 07:25:14 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v6C7PE8k009863; Wed, 12 Jul 2017 07:25:14 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 12 Jul 2017 00:25:13 -0700 Date: Wed, 12 Jul 2017 10:25:06 +0300 From: Dan Carpenter To: Boris Ostrovsky , Stefano Stabellini Message-ID: <20170712072506.3lzevgfwuzgs5u2s@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170113 (1.7.2) X-Source-IP: userv0022.oracle.com [156.151.31.74] Cc: Juergen Gross , xen-devel@lists.xenproject.org, kernel-janitors@vger.kernel.org Subject: [Xen-devel] [PATCH] xen/pvcalls: NULL dereference in error handling X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP We accidentally dereference "map" when it's NULL. Fixes: b535e2b9b78a ("xen/pvcalls: implement connect command") Signed-off-by: Dan Carpenter Reviewed-by: Stefano Stabellini diff --git a/drivers/xen/pvcalls-back.c b/drivers/xen/pvcalls-back.c index d6c4c4aecb41..01b690e1e555 100644 --- a/drivers/xen/pvcalls-back.c +++ b/drivers/xen/pvcalls-back.c @@ -424,7 +424,7 @@ static int pvcalls_back_connect(struct xenbus_device *dev, sock); if (!map) { ret = -EFAULT; - sock_release(map->sock); + sock_release(sock); } out: