mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
Merge "soc: soundwire: check for valid pointer before dereference"
This commit is contained in:
commit
189f783aa9
1 changed files with 7 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
|
|
@ -998,10 +998,14 @@ static int swr_device_match(struct device *dev, struct device_driver *driver)
|
|||
if (!drv)
|
||||
return -EINVAL;
|
||||
|
||||
if (dev->type == &swr_dev_type)
|
||||
if (dev->type == &swr_dev_type) {
|
||||
swr_dev = to_swr_device(dev);
|
||||
else
|
||||
if (!swr_dev)
|
||||
return -EINVAL;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (drv->id_table)
|
||||
return swr_match(drv->id_table, swr_dev) != NULL;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue