dmaengine: idxd: fix uninit var for alt_drv
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: 6e7f3ee97b
("dmaengine: idxd: move dsa_drv support to compatible mode")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/162689250332.2114335.636367120454420852.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
ade8a86b51
commit
568b212646
1 changed files with 1 additions and 1 deletions
|
@ -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 bus_type *bus = drv->bus;
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
struct device_driver *alt_drv;
|
struct device_driver *alt_drv = NULL;
|
||||||
int rc = -ENODEV;
|
int rc = -ENODEV;
|
||||||
struct idxd_dev *idxd_dev;
|
struct idxd_dev *idxd_dev;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue