From patchwork Thu Jul 7 08:04:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 9218177 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 3A88A6048B for ; Thu, 7 Jul 2016 08:06:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FFC82878F for ; Thu, 7 Jul 2016 08:06:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 230162879D; Thu, 7 Jul 2016 08:06:19 +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 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 342612878F for ; Thu, 7 Jul 2016 08:06:17 +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 1bL4I2-0003J6-1G; Thu, 07 Jul 2016 08:04:06 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bL4I0-0003If-CM for xen-devel@lists.xenproject.org; Thu, 07 Jul 2016 08:04:04 +0000 Received: from [193.109.254.147] by server-15.bemta-14.messagelabs.com id 7C/55-07069-3FC0E775; Thu, 07 Jul 2016 08:04:03 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRWlGSWpSXmKPExsXS6fjDS/czT12 4wdS5/Bbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bcZdtYC86zVMw9/YS1gfEjcxcjB4eQQJ7E pPscXYycHLwCdhIti5uYQWwJAUOJffNXsYHYLAKqEidP7WEHsdkE1CXanm1nBbFFBIolOp78Y Oxi5OJgFjjNKHH91g8mkISwgI/EhL3fWUDm8woISvzdIQwSZhbQknj46xYLhK0tsWzha7ATmA WkJZb/45jAyDMLoWEWkoZZSBpmITQsYGRZxahRnFpUllqka2Shl1SUmZ5RkpuYmaNraGiil5t aXJyYnpqTmFSsl5yfu4kRGEz1DAyMOxjXHfc7xCjJwaQkyrvnbm24EF9SfkplRmJxRnxRaU5q 8SFGDQ4OgW27Vl9glGLJy89LVZLgXctdFy4kWJSanlqRlpkDDHeYUgkOHiUR3ucgad7igsTc4 sx0iNQpRl2OBT9ur2USApshJc7bClIkAFKUUZoHNwIWe5cYZaWEeRkZGBiEeApSi3IzS1DlXz GKczAqCfOuAZnCk5lXArfpFdARTEBH/HSpBjmiJBEhJdXA6PhX7/3GxfY1eRrTC/7pzgr7r8h of1r1dmvTttspXTY1bMpXjXMVTsSoXerd9XBl7ekSp98W5vW/X1vqcpxmrff0MmbfGd8rNeuY bNccG6Ur01ucT85XjJp6/eyEee22pZZTn6Wd37kohj3z5eers+z2T/2x+WPvAetbNz6wc2WlL zCLYdnEpcRSnJFoqMVcVJwIAJiyqza4AgAA X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-13.tower-27.messagelabs.com!1467878641!52406081!1 X-Originating-IP: [137.65.248.74] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 3069 invoked from network); 7 Jul 2016 08:04:03 -0000 Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by server-13.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 7 Jul 2016 08:04:03 -0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Thu, 07 Jul 2016 02:04:00 -0600 Message-Id: <577E291002000078000FBF18@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.0 Date: Thu, 07 Jul 2016 02:04:00 -0600 From: "Jan Beulich" To: ,, , Mime-Version: 1.0 Content-Disposition: inline Cc: Juergen Gross , xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com, "tpmdd-devel@lists.sourceforge.net" , david.vrabel@citrix.com Subject: [Xen-devel] [PATCH] xen-tpmfront: correct return value check on xenbus_scanf() 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 Only a positive return value indicates success. Signed-off-by: Jan Beulich Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm/xen-tpmfront.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 4.7-rc6-xenbus_scanf.orig/drivers/char/tpm/xen-tpmfront.c +++ 4.7-rc6-xenbus_scanf/drivers/char/tpm/xen-tpmfront.c @@ -344,7 +344,7 @@ static void backend_changed(struct xenbu break; if (xenbus_scanf(XBT_NIL, dev->otherend, - "feature-protocol-v2", "%d", &val) < 0) + "feature-protocol-v2", "%d", &val) <= 0) val = 0; if (!val) { xenbus_dev_fatal(dev, -EINVAL,