All of lore.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Ignaz Forster <ignaz.forster@gmx.de>,
	Jiri Kosina <jkosina@suse.cz>,
	linux-input@vger.kernel.org
Subject: [PATCH] HID: emsff: properly handle emsff_init failure
Date: Tue, 19 Jul 2011 16:14:04 +0800	[thread overview]
Message-ID: <1311063244.7304.1.camel@phoenix> (raw)

emsff_init() may fail, let's properly handle the failure.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 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:
-- 
1.7.4.1




             reply	other threads:[~2011-07-19  8:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-19  8:14 Axel Lin [this message]
2011-07-20  9:56 ` [PATCH] HID: emsff: properly handle emsff_init failure Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1311063244.7304.1.camel@phoenix \
    --to=axel.lin@gmail.com \
    --cc=ignaz.forster@gmx.de \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.