From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753880AbbJOQlE (ORCPT ); Thu, 15 Oct 2015 12:41:04 -0400 Received: from smtp.citrix.com ([66.165.176.89]:41659 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752266AbbJOQlD (ORCPT ); Thu, 15 Oct 2015 12:41:03 -0400 X-IronPort-AV: E=Sophos;i="5.17,686,1437436800"; d="scan'208";a="306741791" Message-ID: <561FD717.9090807@citrix.com> Date: Thu, 15 Oct 2015 17:40:55 +0100 From: David Vrabel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: Insu Yun , , , , , , , CC: , , Subject: Re: [PATCH] xen: check return value of xenbus_printf References: <1444926315-29106-1-git-send-email-wuninsu@gmail.com> In-Reply-To: <1444926315-29106-1-git-send-email-wuninsu@gmail.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-DLP: MIA1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/10/15 17:25, Insu Yun wrote: > 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. [...] > --- a/drivers/input/misc/xen-kbdfront.c > +++ b/drivers/input/misc/xen-kbdfront.c > @@ -129,8 +129,11 @@ 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"); I think you want abs = 0 here or input device will be configured as absolute but the backend will supply relative coordinates. David