From patchwork Thu Jan 6 08:00:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Achatz X-Patchwork-Id: 457971 X-Patchwork-Delegate: jikos@jikos.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0681IKq018275 for ; Thu, 6 Jan 2011 08:03:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751648Ab1AFIAs (ORCPT ); Thu, 6 Jan 2011 03:00:48 -0500 Received: from mail-in-05.arcor-online.net ([151.189.21.45]:60493 "EHLO mail-in-05.arcor-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751855Ab1AFIAn (ORCPT ); Thu, 6 Jan 2011 03:00:43 -0500 Received: from mail-in-14-z2.arcor-online.net (mail-in-14-z2.arcor-online.net [151.189.8.31]) by mx.arcor.de (Postfix) with ESMTP id 987E6E3C73; Thu, 6 Jan 2011 09:00:42 +0100 (CET) Received: from mail-in-11.arcor-online.net (mail-in-11.arcor-online.net [151.189.21.51]) by mail-in-14-z2.arcor-online.net (Postfix) with ESMTP id 8C0D31BB2A2; Thu, 6 Jan 2011 09:00:42 +0100 (CET) Received: from [192.168.0.7] (dslb-084-057-049-077.pools.arcor-ip.net [84.57.49.77]) (Authenticated sender: screamingfist@arcor.de) by mail-in-11.arcor-online.net (Postfix) with ESMTPSA id 07F8635A399; Thu, 6 Jan 2011 09:00:41 +0100 (CET) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-11.arcor-online.net 07F8635A399 Subject: [PATCH 2/2] HID: roccat: Fix an error message when reading more data from bin attributes From: Stefan Achatz Reply-To: erazor_de@users.sourceforge.net To: Randy Dunlap , Jiri Kosina , Stefan Achatz , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Date: Thu, 06 Jan 2011 09:00:41 +0100 Message-ID: <1294300841.5622.59.camel@neuromancer> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 (2.30.3-1.fc13) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 06 Jan 2011 08:03:08 +0000 (UTC) diff --git a/drivers/hid/hid-roccat-koneplus.c b/drivers/hid/hid-roccat-koneplus.c index 1608c8d..2df87bb 100644 --- a/drivers/hid/hid-roccat-koneplus.c +++ b/drivers/hid/hid-roccat-koneplus.c @@ -256,6 +256,9 @@ static ssize_t koneplus_sysfs_read(struct file *fp, struct kobject *kobj, struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev)); int retval; + if (off >= real_size) + return 0; + if (off != 0 || count != real_size) return -EINVAL;