提交 a608a9da 编写于 作者: D Dave Jiang 提交者: Xiaochen Shen

dmaengine: idxd: fix uninit var for alt_drv

mainline inclusion
from mainline-v5.15
commit 568b2126
category: bugfix
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I596WO
CVE: NA

Intel-SIG: commit 568b2126 dmaengine: idxd: fix uninit var for alt_drv.
Incremental backporting patches for DSA/IAA on Intel Xeon platform.

--------------------------------

0-day detected uninitialized alt_drv variable in the bind_store() function.
The branch can be taken when device is not idxd device or wq 'struct
device'. Init alt_drv to NULL.

Fixes: 6e7f3ee9 ("dmaengine: idxd: move dsa_drv support to compatible mode")
Reported-by: Nkernel test robot <lkp@intel.com>
Signed-off-by: NDave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/162689250332.2114335.636367120454420852.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
Signed-off-by: NXiaochen Shen <xiaochen.shen@intel.com>
上级 ca11cd5f
......@@ -34,7 +34,7 @@ static ssize_t bind_store(struct device_driver *drv, const char *buf, size_t cou
{
struct bus_type *bus = drv->bus;
struct device *dev;
struct device_driver *alt_drv;
struct device_driver *alt_drv = NULL;
int rc = -ENODEV;
struct idxd_dev *idxd_dev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册