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: 1778281 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 3CBB03FC23 for ; Wed, 21 Nov 2012 06:26:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750870Ab2KUG0r (ORCPT ); Wed, 21 Nov 2012 01:26:47 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:59725 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750824Ab2KUG0q (ORCPT ); Wed, 21 Nov 2012 01:26:46 -0500 Received: by mail-pa0-f46.google.com with SMTP id bh2so1840080pad.19 for ; Tue, 20 Nov 2012 22:26:46 -0800 (PST) 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=qNjFtmrsIK3iYaRV7wFdWM8ovFbQyDOrY/xFqoH5zV8=; b=nhhuVUZstw/0d4vf0LnIrb54fCdiwm8v627Qpbn2aEnfw8g8PhfE+bJdSUGVSe/YwR u04KE74hqoe9/+R3Z4A88wIdMHKj+89F9yTe41qS/ZdBvnbtTXFCSOZVzu79FPBoIp8y 5KXRiT263UYE+TaxkJU79Ap8H2vam00cdMWbzs3gk94f33CGmU0J37ICL5j5s0HUddDu hOlS86P4K3r9K5JaWA1AnVIcyUspdT7decorEqieiclzi1yjorHu5eHfip7vrOKHV7wT tfrqPFFdXibjeHWSzGAXyxMnNA7He+I/SKcOY4yshqBVsU3XptPJOQasymrbwuhxRLWJ X3IA== 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: ALoCoQmu6FJllzZDsjKBl584LObooWcKEb8g1Jwu2z7jHqnlUQjvkdqp7pLHb1PN9E9B560rVPbm Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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);