From patchwork Wed Nov 21 06:20:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13025 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 CE93E23FC9 for ; Wed, 21 Nov 2012 06:26:48 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 7CD8DA182A3 for ; Wed, 21 Nov 2012 06:26:48 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so9415649iej.11 for ; Tue, 20 Nov 2012 22:26:48 -0800 (PST) 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=qNjFtmrsIK3iYaRV7wFdWM8ovFbQyDOrY/xFqoH5zV8=; b=om/BQqPeb5TdjTDRKhrrRxLnHkRqllX0FUF6knp7svJZAnpPrEqpux8ciuAT1uielD 88zD6TC6739kDOc4nznqn1/ei75l+BY80ZOtFpOPWv1RHzcGL/ldUiCHq53BLcWs7R1j kSYCLD3SrxPFCvaX06aVBleWkut5mSwigLyt7PzUDu/XdcvIG2wvSx+5eiOS29cpniXf f9ZmV/V28AvKhmTs2wmrANw+lNm/KGDgVWQcY8/1XebFT/yRiJqKsANt98VlBrkRQhcT EZEkjXJB9JYxGOygkRrN8pXKxi9/E77bPjLgDHHXBZlYgqJ9Eu/H+OQozjc3i8Z40iee RD2w== Received: by 10.50.213.34 with SMTP id np2mr12614283igc.57.1353479207935; Tue, 20 Nov 2012 22:26:47 -0800 (PST) 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.67.148 with SMTP id n20csp440280igt; Tue, 20 Nov 2012 22:26:47 -0800 (PST) Received: by 10.66.85.138 with SMTP id h10mr15062847paz.40.1353479206980; Tue, 20 Nov 2012 22:26:46 -0800 (PST) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx.google.com with ESMTPS id uq10si21390412pbc.227.2012.11.20.22.26.46 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 22:26:46 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.45 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.45; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.45 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-pa0-f45.google.com with SMTP id bg2so2260266pad.4 for ; Tue, 20 Nov 2012 22:26:46 -0800 (PST) Received: by 10.68.238.199 with SMTP id vm7mr55713452pbc.105.1353479206568; Tue, 20 Nov 2012 22:26:46 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id os5sm9383907pbc.15.2012.11.20.22.26.40 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 22:26:44 -0800 (PST) From: Sachin Kamat To: linux-input@vger.kernel.org Cc: jkosina@suse.cz, jic23@kernel.org, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/2] hid: usbhid: Return -ENOMEM instead of -1 for memory allocation failure Date: Wed, 21 Nov 2012 11:50:29 +0530 Message-Id: <1353478830-23788-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQk6ZrD7ZAoOxf0fqqIU7B2rIn/3bdeoifYGf9Ksiz6AIoDs3vjQBMDqlOZTr65alSjVssu1 Silences the following smatch warning: drivers/hid/usbhid/hiddev.c:897 hiddev_connect() warn: returning -1 instead of -ENOMEM is sloppy Signed-off-by: Sachin Kamat --- drivers/hid/usbhid/hiddev.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index 14599e2..50e2ab8 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c @@ -894,7 +894,7 @@ int hiddev_connect(struct hid_device *hid, unsigned int force) } if (!(hiddev = kzalloc(sizeof(struct hiddev), GFP_KERNEL))) - return -1; + return -ENOMEM; init_waitqueue_head(&hiddev->wait); INIT_LIST_HEAD(&hiddev->list);