From patchwork Tue Jul 19 08:14:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: axel lin X-Patchwork-Id: 988392 X-Patchwork-Delegate: jikos@jikos.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6J8EQ0x021106 for ; Tue, 19 Jul 2011 08:14:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752527Ab1GSIOZ (ORCPT ); Tue, 19 Jul 2011 04:14:25 -0400 Received: from mail-yw0-f46.google.com ([209.85.213.46]:43009 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752487Ab1GSIOY (ORCPT ); Tue, 19 Jul 2011 04:14:24 -0400 Received: by ywe9 with SMTP id 9so1675718ywe.19 for ; Tue, 19 Jul 2011 01:14:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=sgr2WS7mRMDHJv8QaYq548jYh5P4HCAKmtQmf1/untI=; b=RAB8mxOCCsjk4WhuWihDhMI17D9qtuUCokCtfvoICH6sAC/z3U8GiYQ6cfSHjqCKe2 LzriIWZMAMFQ6pBLoitDDJj7MWWmanfiZE5dg6+HwZEGJIW0S9Of/JZJxoIUNEhR0l06 RhVhN3P9JxTTgtoqvphYw+ObxqbBxzbFGXfPA= Received: by 10.236.186.10 with SMTP id v10mr9104825yhm.292.1311063263623; Tue, 19 Jul 2011 01:14:23 -0700 (PDT) Received: from [218.172.238.48] (218-172-238-48.dynamic.hinet.net [218.172.238.48]) by mx.google.com with ESMTPS id v4sm772277yhm.48.2011.07.19.01.14.18 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 19 Jul 2011 01:14:23 -0700 (PDT) Subject: [PATCH] HID: emsff: properly handle emsff_init failure From: Axel Lin To: linux-kernel@vger.kernel.org Cc: Ignaz Forster , Jiri Kosina , linux-input@vger.kernel.org Date: Tue, 19 Jul 2011 16:14:04 +0800 Message-ID: <1311063244.7304.1.camel@phoenix> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 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.6 (demeter2.kernel.org [140.211.167.43]); Tue, 19 Jul 2011 08:14:27 +0000 (UTC) emsff_init() may fail, let's properly handle the failure. Signed-off-by: Axel Lin --- drivers/hid/hid-emsff.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/hid/hid-emsff.c b/drivers/hid/hid-emsff.c index 81877c6..a5dc13f 100644 --- a/drivers/hid/hid-emsff.c +++ b/drivers/hid/hid-emsff.c @@ -126,7 +126,12 @@ static int ems_probe(struct hid_device *hdev, const struct hid_device_id *id) goto err; } - emsff_init(hdev); + ret = emsff_init(hdev); + if (ret) { + dev_err(&hdev->dev, "force feedback init failed\n"); + hid_hw_stop(hdev); + goto err; + } return 0; err: