From patchwork Sat Aug 28 12:57:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Achatz X-Patchwork-Id: 139501 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 o7SCwKRp028745 for ; Sat, 28 Aug 2010 12:58:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753348Ab0H1M57 (ORCPT ); Sat, 28 Aug 2010 08:57:59 -0400 Received: from mail-in-04.arcor-online.net ([151.189.21.44]:42590 "EHLO mail-in-04.arcor-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753192Ab0H1M56 (ORCPT ); Sat, 28 Aug 2010 08:57:58 -0400 Received: from mail-in-15-z2.arcor-online.net (mail-in-15-z2.arcor-online.net [151.189.8.32]) by mx.arcor.de (Postfix) with ESMTP id BB0D8AA086; Sat, 28 Aug 2010 14:57:55 +0200 (CEST) Received: from mail-in-17.arcor-online.net (mail-in-17.arcor-online.net [151.189.21.57]) by mail-in-15-z2.arcor-online.net (Postfix) with ESMTP id B66E333E3BF; Sat, 28 Aug 2010 14:57:55 +0200 (CEST) Received: from [192.168.0.7] (dslb-088-065-133-090.pools.arcor-ip.net [88.65.133.90]) by mail-in-17.arcor-online.net (Postfix) with ESMTPS id 9252CCBE60; Sat, 28 Aug 2010 14:57:54 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-17.arcor-online.net 9252CCBE60 Subject: [PATCH] HID: roccat: Fixing race condition on initialization From: Stefan Achatz Reply-To: erazor_de@users.sourceforge.net To: Jiri Kosina , Stefan Achatz , Stephen Rothwell , Tejun Heo , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sat, 28 Aug 2010 14:57:48 +0200 Message-ID: <1283000268.4789.1.camel@neuromancer> Mime-Version: 1.0 X-Mailer: Evolution 2.30.2 (2.30.2-4.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]); Sat, 28 Aug 2010 12:58:22 +0000 (UTC) diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c index f776957..cfeab56 100644 --- a/drivers/hid/hid-roccat-kone.c +++ b/drivers/hid/hid-roccat-kone.c @@ -966,6 +966,10 @@ static int kone_raw_event(struct hid_device *hdev, struct hid_report *report, struct kone_device *kone = hid_get_drvdata(hdev); struct kone_mouse_event *event = (struct kone_mouse_event *)data; + /* possible race condition on initialization */ + if (!kone) + return 0; + /* keyboard events are always processed by default handler */ if (size != sizeof(struct kone_mouse_event)) return 0;