put_device() must be called after device_register() fails, since device_register() always initializes the refcount on the device structure to one.
dev->id is free'd inside of ipack_device_release function. So, it's not needed to do it here. Signed-off-by: Samuel Iglesias Gonsalvez <sigles...@igalia.com> --- drivers/ipack/ipack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ipack/ipack.c b/drivers/ipack/ipack.c index 7ec6b20..3588ccf 100644 --- a/drivers/ipack/ipack.c +++ b/drivers/ipack/ipack.c @@ -449,7 +449,7 @@ int ipack_device_register(struct ipack_device *dev) ret = device_register(&dev->dev); if (ret < 0) - kfree(dev->id); + put_device(&dev->dev); return ret; } -- 1.7.10.4 ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb _______________________________________________ Industrypack-devel mailing list Industrypack-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/industrypack-devel