mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
w1: use put_device() if device_register() fail
If device_register() returned an error! Always use put_device() to give up the reference initialized in device_register(). Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
aeef9c0974
commit
0ec4eb71b4
@ -706,6 +706,7 @@ static int __w1_attach_slave_device(struct w1_slave *sl)
|
||||
dev_err(&sl->dev,
|
||||
"Device registration [%s] failed. err=%d\n",
|
||||
dev_name(&sl->dev), err);
|
||||
put_device(&sl->dev);
|
||||
return err;
|
||||
}
|
||||
w1_family_notify(BUS_NOTIFY_ADD_DEVICE, sl);
|
||||
|
Loading…
Reference in New Issue
Block a user