From patchwork Mon Oct 19 14:10:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Insu Yun X-Patchwork-Id: 7437381 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9159B9F302 for ; Mon, 19 Oct 2015 14:09:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 863572067D for ; Mon, 19 Oct 2015 14:09:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A827620684 for ; Mon, 19 Oct 2015 14:09:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753047AbbJSOJZ (ORCPT ); Mon, 19 Oct 2015 10:09:25 -0400 Received: from mail-yk0-f180.google.com ([209.85.160.180]:36495 "EHLO mail-yk0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751063AbbJSOJX (ORCPT ); Mon, 19 Oct 2015 10:09:23 -0400 Received: by ykdz2 with SMTP id z2so58413701ykd.3; Mon, 19 Oct 2015 07:09:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=LB0LuChx9JQgMcjzOxUXHO6UNbtpmT4mRcoOZGlMDaI=; b=gfyTYdOAAdaayEKflsQIXGfXoP6FNeIVqh14bpyXdNgpTQ4NYo/+jiqwH6JgUl0Gqt 0ZAMxxlGwBcGpGn0ZcbToo8KgjxU6C0LJP0DvEDx0RVG9L6M28Ht/RYj19qKkvNG3cDC vfEbPP+xw04Rzz2v2nZ+A41RLRPrcjrqVeYog3o0MwIYWMW3Qi+yoUqP2Wwn5quNu9RM y7kXtBM049Z/jabYD1vWYOoyIBWchd1h1XumLMPna7JfBmhH7nlxMa7WfKejTnZK/ol0 P7FKgxwRgQBOmmC0CjOqd2PVsXzIXuFfP1xmtyo4VfDRFRW9TMfzyz9G+E/22lA2zbW2 CCiQ== X-Received: by 10.13.228.65 with SMTP id n62mr20169400ywe.302.1445263762459; Mon, 19 Oct 2015 07:09:22 -0700 (PDT) Received: from cutthroat.gtisc.gatech.edu (cutthroat.gtisc.gatech.edu. [128.61.240.77]) by smtp.gmail.com with ESMTPSA id y184sm26343517ywe.23.2015.10.19.07.09.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Oct 2015 07:09:21 -0700 (PDT) From: Insu Yun To: dmitry.torokhov@gmail.com, stefano.stabellini@eu.citrix.com, david.vrabel@citrix.com, wei.liu2@citrix.com, julien.grall@citrix.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: taesoo@gatech.edu, yeongjin.jang@gatech.edu, insu@gatech.edu, changwoo@gatech.edu, Insu Yun Subject: [PATCH] xen: check return value of xenbus_printf Date: Mon, 19 Oct 2015 14:10:40 +0000 Message-Id: <1445263840-21187-1-git-send-email-wuninsu@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Internally, xenbus_printf uses memory allocation, so it can be failed in memory pressure.Therefore, xenbus_printf's return should be checked and properly handled. Signed-off-by: Insu Yun Reviewed-by: Julien Grall --- drivers/input/misc/xen-kbdfront.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c index 23d0549..9d465d7 100644 --- a/drivers/input/misc/xen-kbdfront.c +++ b/drivers/input/misc/xen-kbdfront.c @@ -129,8 +129,14 @@ static int xenkbd_probe(struct xenbus_device *dev, if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-abs-pointer", "%d", &abs) < 0) abs = 0; - if (abs) - xenbus_printf(XBT_NIL, dev->nodename, "request-abs-pointer", "1"); + if (abs) { + ret = xenbus_printf(XBT_NIL, dev->nodename, + "request-abs-pointer", "1"); + if (ret) { + pr_warning("xenkbd: can't request abs-pointer"); + abs = 0; + } + } /* keyboard */ kbd = input_allocate_device();