From: Alex Elder Date: Tue, 9 Sep 2014 18:55:06 +0000 (-0500) Subject: greybus: call put_device() on error X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~2129 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a5808add9a6cae290af60bb3b4efd2c9d3208588;p=users%2Fjedix%2Flinux-maple.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c index 95655e258e84..3bb8f9cb55f8 100644 --- a/drivers/staging/greybus/core.c +++ b/drivers/staging/greybus/core.c @@ -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; }