pcmcia: ds: fix device_register() error handling
Subsystems (2)
PATCH 7/14 pcmcia: ds: fix device_register() error handling
If device_register() fails then call put_device(). See comment to device_register.
Signed-off-by Vasiliy Kulikov <[email protected]>
---
compile tested.
drivers/pcmcia/ds.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/pcmcia/ds.c +3 -1
@@ -582,10 +582,12 @@ static struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s,pcmcia_device_query (p_dev);if (device_register (&p_dev->dev)) - goto err_unreg; + goto err_put_device;return p_dev; + err_put_device: +put_device (&p_dev->dev); err_unreg:mutex_lock (&s->ops_mutex);list_del (&p_dev->socket_device_list);
Signature · 1 line
1.7.0.4
Quoted 4 lines · Vasiliy Kulikov
If
device_register()fails then callput_device(). See comment todevice_register.Signed-off-by Vasiliy Kulikov <[email protected]>
Thanks,
Dominik