WMI: embed struct device directly into wmi_block
Instead of creating wmi_blocks and then register corresponding devices on a separate pass do it all in one shot, since lifetime rules for both objects are the same. This also takes care of leaking devices when device_create fails for one of them. Signed-off-by: NDmitry Torokhov <dtor@mail.ru> Signed-off-by: NMatthew Garrett <mjg@redhat.com>
Showing
想要评论请 注册 或 登录