From patchwork Mon Oct 18 13:45:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 261961 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 o9IDuAVo011398 for ; Mon, 18 Oct 2010 13:56:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755939Ab0JRNzI (ORCPT ); Mon, 18 Oct 2010 09:55:08 -0400 Received: from mail.bugwerft.de ([212.112.241.193]:50585 "EHLO mail.bugwerft.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755803Ab0JRNzE (ORCPT ); Mon, 18 Oct 2010 09:55:04 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.bugwerft.de (Postfix) with ESMTP id 506F98FC04D; Mon, 18 Oct 2010 15:45:43 +0200 (CEST) Received: from mail.bugwerft.de ([127.0.0.1]) by localhost (rambrand.caiaq.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BCe9EKtjeNMP; Mon, 18 Oct 2010 15:45:43 +0200 (CEST) Received: from jup.xaos.intra (port-92-206-115-104.dynamic.qsc.de [92.206.115.104]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bugwerft.de (Postfix) with ESMTPSA id D6D1E8F8412; Mon, 18 Oct 2010 15:45:42 +0200 (CEST) From: Daniel Mack To: linux-kernel@vger.kernel.org Cc: s.neumann@raumfeld.com, linux-input@vger.kernel.org, Daniel Mack , Dmitry Torokhov Subject: [PATCH 1/2] input: fix Ooops with EVIOCGABS/EVIOCSABS on devices without absinfo Date: Mon, 18 Oct 2010 15:45:23 +0200 Message-Id: <1287409524-3032-1-git-send-email-zonque@gmail.com> X-Mailer: git-send-email 1.7.1 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]); Mon, 18 Oct 2010 13:56:10 +0000 (UTC) diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index c908c5f..afb64cf 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -669,6 +669,9 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd, if ((_IOC_NR(cmd) & ~ABS_MAX) == _IOC_NR(EVIOCGABS(0))) { + if (!dev->absinfo) + return -EINVAL; + t = _IOC_NR(cmd) & ABS_MAX; abs = dev->absinfo[t]; @@ -684,6 +687,9 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd, if ((_IOC_NR(cmd) & ~ABS_MAX) == _IOC_NR(EVIOCSABS(0))) { + if (!dev->absinfo) + return -EINVAL; + t = _IOC_NR(cmd) & ABS_MAX; if (copy_from_user(&abs, p, min_t(size_t,