mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 07:03:09 -04:00
qcacld-3.0: Avoid NULL dereference in hdd_init_qdf_ctx()
Currently hdd_init_qdf_ctx() calls cds_get_context() to retrieve the QDF Device context, and then writes into the context without validating the pointer. Add logic to validate the pointer before using it. Change-Id: Ib427d1348b3ff5b13689e24f69e4606f23ea767c CRs-Fixed: 1042043
This commit is contained in:
parent
e54e2ae247
commit
615d4bbfff
1 changed files with 5 additions and 0 deletions
|
|
@ -294,6 +294,11 @@ void hdd_init_qdf_ctx(struct device *dev, void *bdev,
|
|||
{
|
||||
qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
|
||||
|
||||
if (!qdf_dev) {
|
||||
hdd_err("Invalid QDF device");
|
||||
return;
|
||||
}
|
||||
|
||||
qdf_dev->dev = dev;
|
||||
qdf_dev->drv_hdl = bdev;
|
||||
qdf_dev->bus_type = bus_type;
|
||||
|
|
|
|||
Loading…
Reference in a new issue