Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

base: soc: use put_device() instead of kfree()

Never directly free @dev after calling device_register(), even
if it returned an error! Always use put_device() to give up the
reference initialized.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Arvind Yadav and committed by
Greg Kroah-Hartman
ef49ec1d 9de9a449

+2
+2
drivers/base/soc.c
··· 150 150 151 151 out3: 152 152 ida_simple_remove(&soc_ida, soc_dev->soc_dev_num); 153 + put_device(&soc_dev->dev); 154 + soc_dev = NULL; 153 155 out2: 154 156 kfree(soc_dev); 155 157 out1: