power: fix incorrect unregistration in power_supply_create_attrs error path
In power_supply_create_attrs(), we create static attributes as referenced by power_supply_static_attrs[i]. After that, if we fail, we unregister via power_supply_static_attrs[psy->properties[i]]. This is incorrect, as psy->properties has absolutely no bearing on static attribs. This patch fixes it to unregister the correct attrib. Another line which was unnecessarily line wrapped is also unwrapped. Signed-off-by: NAndres Salomon <dilinger@debian.org> Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
Showing
想要评论请 注册 或 登录