mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04: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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
c56d8a7362
commit
2b31594a95
1 changed files with 4 additions and 2 deletions
|
|
@ -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 a new issue