]> www.infradead.org Git - users/dwmw2/linux.git/commit
HID: i2c-hid: Use devm to allocate i2c_hid struct
authorStephen Boyd <swboyd@chromium.org>
Fri, 22 Jun 2018 02:27:16 +0000 (19:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Oct 2018 23:59:14 +0000 (16:59 -0700)
commitd0f7fbdb1cf98e37b3c61b503d41578517cede1c
tree5afc8bb262263e66f459e34f3f1d04a69bcffc70
parent46066a10dd7acaedfb681c878ed483e5d641fb72
HID: i2c-hid: Use devm to allocate i2c_hid struct

[ Upstream commit d6f83894110de247a81392ab7ef89e5498df7e80 ]

Use devm here to save some lines and prepare for bulk regulator usage in
this driver. Otherwise, when we devm bulk get regulators we'll free the
containing i2c_hid structure and try to put regulator pointers from
freed memory.

Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Dmitry Torokhov <dtor@chromium.org>
Cc: Doug Anderson <dianders@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/i2c-hid/i2c-hid.c