From patchwork Thu Jul 7 07:53:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 9218017 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 AB005607D9 for ; Thu, 7 Jul 2016 07:53:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A15412878D for ; Thu, 7 Jul 2016 07:53:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 960142878F; Thu, 7 Jul 2016 07:53:44 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 048AC2878D for ; Thu, 7 Jul 2016 07:53:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756191AbcGGHxm (ORCPT ); Thu, 7 Jul 2016 03:53:42 -0400 Received: from prv-mh.provo.novell.com ([137.65.248.74]:33983 "EHLO prv-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751106AbcGGHxl convert rfc822-to-8bit (ORCPT ); Thu, 7 Jul 2016 03:53:41 -0400 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Thu, 07 Jul 2016 01:53:41 -0600 Message-Id: <577E26A402000078000FBE93@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.0 Date: Thu, 07 Jul 2016 01:53:40 -0600 From: "Jan Beulich" To: Cc: , , , "Juergen Gross" , Subject: [PATCH] xen-kbdfront: correct return value checks on xenbus_scanf() Mime-Version: 1.0 Content-Disposition: inline Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Only a positive return value indicates success. Signed-off-by: Jan Beulich --- drivers/input/misc/xen-kbdfront.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 4.7-rc6-xenbus_scanf.orig/drivers/input/misc/xen-kbdfront.c +++ 4.7-rc6-xenbus_scanf/drivers/input/misc/xen-kbdfront.c @@ -127,7 +127,8 @@ static int xenkbd_probe(struct xenbus_de if (!info->page) goto error_nomem; - if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-abs-pointer", "%d", &abs) < 0) + if (xenbus_scanf(XBT_NIL, dev->otherend, + "feature-abs-pointer", "%d", &abs) <= 0) abs = 0; if (abs) { ret = xenbus_printf(XBT_NIL, dev->nodename, @@ -324,7 +325,7 @@ static void xenkbd_backend_changed(struc InitWait: ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend, "feature-abs-pointer", "%d", &val); - if (ret < 0) + if (ret <= 0) val = 0; if (val) { ret = xenbus_printf(XBT_NIL, info->xbdev->nodename,