Re: [PATCH 1/4] HID: hid-ntrig add multi input quirk and clean up
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2010-02-12 01:21:06
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2010-02-12 01:21:06
On Thu, Feb 11, 2010 at 08:03:52PM -0500, Rafi Rubin wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1quoted
quoted
nd = kmalloc(sizeof(struct ntrig_data), GFP_KERNEL); if (!nd) {@@ -255,14 +271,36 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) if (!ret) ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); - if (ret) + if (ret) { kfree (nd);What about hid_hw_stop()? Overall I'd rather see the standard error unwinding path with gotos.Cleaning up the probe function. But it looks like the last caught error is from start, so is it fair to leave out stop?
Ah, yes, my bad. -- Dmitry