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: 1457651 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 97644DF280 for ; Fri, 14 Sep 2012 11:49:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755794Ab2INLt1 (ORCPT ); Fri, 14 Sep 2012 07:49:27 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:46423 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753952Ab2INLt1 (ORCPT ); Fri, 14 Sep 2012 07:49:27 -0400 Received: by pbbrr13 with SMTP id rr13so5511808pbb.19 for ; Fri, 14 Sep 2012 04:49:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=RLrsoK02xVcLnGDe6jfV2znA5fkNlvQ6trpkA+U1gJc=; b=ODKmX37vYjy67dnH++hs5NCgOtEOSx+PT8i5eR65ucHifiQEZlKpsDu+ybJ7zfWDYj DmBU0ATehfYeuDSSCd/eok5lSLQ8FmmzqB+KoPw1mkGrz63YTyJ7JL9opcwUiGwTOe8V VYluR6/6eg4jlZmQ9bq58x1Yit2Hxbm17+AY1l732tFAj/Plj8mjZ4cY1ZLV/rZUGzBp C9QJp1y6wcFYdaBbz6XUe0xsiye8+J5zmA/jylNCpM6YjuqL7SZsS7POqShPnwZiCpth DR42MWHjmtJBNqO+4ij+HIOFUmOMu5oPlcUJXJQOW3nHGuVXqNtxD6Wu43US9nxHkDsn N9RA== 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: ALoCoQlDG8O5rmkiZtGQQdymSutPSB+9wA2Xv3lObuXFFAge2uFKmLDGxLeOqLjklrkyeYlNGbs9 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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) *