dmi-id: don't free dev structure after calling device_register
authorAllen Hung <allen_hung@dell.com>
Fri, 15 Jul 2016 09:42:22 +0000 (17:42 +0800)
committerJean Delvare <jdelvare@suse.de>
Thu, 8 Sep 2016 08:35:50 +0000 (10:35 +0200)
commit9b41b92bbae6a4d3e1f3adde87864fd481037814
tree4d433b5ae15b28eea2fa6dd81fe9fe360c7391f2
parentd71f058617564750261b673ea9b3352382b9cde4
dmi-id: don't free dev structure after calling device_register

dmi_dev is freed in error exit code but, according to the document
of device_register, it should never directly free device structure
after calling this function, even if it returned an error! Use
put_device() instead.

Signed-off-by: Allen Hung <allen_hung@dell.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
drivers/firmware/dmi-id.c