mirror of
https://github.com/torvalds/linux.git
synced 2024-11-01 01:31:44 +00:00
driver-core: Fix possible null reference in subsys_interface_unregister
Check if the sif is not NULL before de-referencing it Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
c56d8a7362
commit
2b31594a95
@ -1193,13 +1193,15 @@ EXPORT_SYMBOL_GPL(subsys_interface_register);
|
||||
|
||||
void subsys_interface_unregister(struct subsys_interface *sif)
|
||||
{
|
||||
struct bus_type *subsys = sif->subsys;
|
||||
struct bus_type *subsys;
|
||||
struct subsys_dev_iter iter;
|
||||
struct device *dev;
|
||||
|
||||
if (!sif)
|
||||
if (!sif || !sif->subsys)
|
||||
return;
|
||||
|
||||
subsys = sif->subsys;
|
||||
|
||||
mutex_lock(&subsys->p->mutex);
|
||||
list_del_init(&sif->node);
|
||||
if (sif->remove_dev) {
|
||||
|
Loading…
Reference in New Issue
Block a user