提交 6acf70f0 编写于 作者: M Ming Lei 提交者: Greg Kroah-Hartman

driver core: firmware_class: replace kfree(dev) with put_device(dev)

against v2.6.30-rc3-next tree.
Signed-off-by: NMing Lei <tom.leiming@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 557411eb
......@@ -356,7 +356,7 @@ static void fw_dev_release(struct device *dev)
__free_page(fw_priv->pages[i]);
kfree(fw_priv->pages);
kfree(fw_priv);
kfree(dev);
put_device(dev);
module_put(THIS_MODULE);
}
......@@ -400,14 +400,16 @@ static int fw_register_device(struct device **dev_p, const char *fw_name,
retval = device_register(f_dev);
if (retval) {
dev_err(device, "%s: device_register failed\n", __func__);
goto error_kfree;
put_device(f_dev);
goto error_kfree1;
}
*dev_p = f_dev;
return 0;
error_kfree:
kfree(fw_priv);
kfree(f_dev);
error_kfree1:
kfree(fw_priv);
return retval;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册