From patchwork Sat Oct 31 21:19:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjan van de Ven X-Patchwork-Id: 56787 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9VLISS0026836 for ; Sat, 31 Oct 2009 21:18:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933249AbZJaVSM (ORCPT ); Sat, 31 Oct 2009 17:18:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933273AbZJaVSM (ORCPT ); Sat, 31 Oct 2009 17:18:12 -0400 Received: from casper.infradead.org ([85.118.1.10]:58463 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933249AbZJaVSL convert rfc822-to-8bit (ORCPT ); Sat, 31 Oct 2009 17:18:11 -0400 Received: from c-24-20-218-92.hsd1.or.comcast.net ([24.20.218.92] helo=localhost.localdomain) by casper.infradead.org with esmtpsa (Exim 4.69 #1 (Red Hat Linux)) id 1N4LKs-000848-T8; Sat, 31 Oct 2009 21:18:11 +0000 Date: Sat, 31 Oct 2009 14:19:25 -0700 From: Arjan van de Ven To: linux-kernel@vger.kernel.org Cc: akpm@linux-foundation.org, Dmitry Torokhov , Anssi Hannula , Jussi Kivilinna , linux-input@vger.kernel.org Subject: [PATCH] input: fix locking context in ml_ff_set_gain Message-ID: <20091031141925.149c9874@infradead.org> Organization: Intel X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.6; i586-redhat-linux-gnu) Mime-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org See http://www.infradead.org/rpr.html Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c index 2d1415e..1a0bb4f 100644 --- a/drivers/input/ff-memless.c +++ b/drivers/input/ff-memless.c @@ -380,8 +380,9 @@ static void ml_ff_set_gain(struct input_dev *dev, u16 gain) { struct ml_device *ml = dev->ff->private; int i; + unsigned long flags; - spin_lock_bh(&ml->timer_lock); + spin_lock_irqsave(&ml->timer_lock, flags); ml->gain = gain; @@ -390,7 +391,7 @@ static void ml_ff_set_gain(struct input_dev *dev, u16 gain) ml_play_effects(ml); - spin_unlock_bh(&ml->timer_lock); + spin_unlock_irqrestore(&ml->timer_lock, flags); } static int ml_ff_playback(struct input_dev *dev, int effect_id, int value)