From patchwork Fri Sep 14 11:46:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 11417 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 6D7E623E42 for ; Fri, 14 Sep 2012 11:49:37 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id A9F97A33F30 for ; Fri, 14 Sep 2012 11:49:36 +0000 (UTC) Received: by iafj25 with SMTP id j25so2900724iaf.11 for ; Fri, 14 Sep 2012 04:49:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=RLrsoK02xVcLnGDe6jfV2znA5fkNlvQ6trpkA+U1gJc=; b=MEbkZ7LLsMTU4mIp5eo6l92dKZWLS9V6QkC1FeRHilcbaE8WGowINhFRiyB3l3Sy5w PoeX96euPJxstASlh7xBtJKjZU/iKwNzPUuJtcCOS9ebxwrCamIMCP4lsozv5OYt7nLT 0TeTDJE12iANynEWnz+6UvnyzmYNQeAWTMM2UbpmEtX6XooYOmZgcO539ZZW+N6X0ygW GiaaHDFF7C3lW4oyhUKrHCj3LWIz1zraiEURzquGiaFnOmOAb7BehauKGoERY1hfvEML TM9lVusKEL2H3zd97qQOd3Q/qvfZSzdFMVdiuyVLoQgz4tXk9oOZM76GZgWN3X0iHKq4 ZiEw== Received: by 10.50.7.212 with SMTP id l20mr2768041iga.43.1347623376053; Fri, 14 Sep 2012 04:49:36 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp185503igc; Fri, 14 Sep 2012 04:49:35 -0700 (PDT) Received: by 10.68.226.33 with SMTP id rp1mr4950232pbc.7.1347623374568; Fri, 14 Sep 2012 04:49:34 -0700 (PDT) Received: from mail-pz0-f50.google.com (mail-pz0-f50.google.com [209.85.210.50]) by mx.google.com with ESMTPS id qs7si2351296pbc.222.2012.09.14.04.49.26 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 14 Sep 2012 04:49:34 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.210.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by dade7 with SMTP id e7so2884725dad.37 for ; Fri, 14 Sep 2012 04:49:26 -0700 (PDT) Received: by 10.66.75.168 with SMTP id d8mr3868922paw.63.1347623366570; Fri, 14 Sep 2012 04:49:26 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id wf7sm866787pbc.34.2012.09.14.04.49.23 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 14 Sep 2012 04:49:25 -0700 (PDT) From: Sachin Kamat To: linux-input@vger.kernel.org Cc: jkosina@suse.cz, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH] HID: Fix return value in hid-core.c Date: Fri, 14 Sep 2012 17:16:17 +0530 Message-Id: <1347623177-14221-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQky5AaebBVYmRorWJiPZbSxozP1U7kxp7M9Sk6QY4DYObrYrq/vWnIyW55gq/1NKF0ZGjVN Return -ENOMEM instead of -1 if memory allocation fails. Signed-off-by: Sachin Kamat --- drivers/hid/hid-core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 16d6454..1011a22 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -134,7 +134,7 @@ static int open_collection(struct hid_parser *parser, unsigned type) parser->device->collection_size * 2, GFP_KERNEL); if (collection == NULL) { hid_err(parser->device, "failed to reallocate collection array\n"); - return -1; + return -ENOMEM; } memcpy(collection, parser->device->collection, sizeof(struct hid_collection) *