mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
greybus: call put_device() on error
As soon as we've called device_initialize() we're required to call put_device() in order to drop our reference to the device structure. This was missed in the error path in greybus_new_module(). Fix that. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
badad68e3a
commit
a5808add9a
@@ -440,6 +440,7 @@ struct greybus_device *greybus_new_module(struct device *parent,
|
||||
|
||||
return gdev;
|
||||
error:
|
||||
put_device(&gdev->dev);
|
||||
greybus_module_release(&gdev->dev);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user