]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: amd-mp2-pci: Fix Oops in amd_mp2_pci_init() error handling
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 10 Sep 2019 13:42:42 +0000 (16:42 +0300)
committerWolfram Sang <wsa@the-dreams.de>
Thu, 30 Apr 2020 14:11:41 +0000 (16:11 +0200)
commit70ac60646e959bd33b2f70434095b4dde472394a
tree37788d588f0978cd985c251c9de6858995810f62
parenta6b34430786683f9953d22aadc7b8f364e8e8f70
i2c: amd-mp2-pci: Fix Oops in amd_mp2_pci_init() error handling

The problem is that we dereference "privdata->pci_dev" when we print
the error messages in amd_mp2_pci_init():

dev_err(ndev_dev(privdata), "Failed to enable MP2 PCI device\n");
^^^^^^^^^^^^^^^^^

Fixes: ef4205193b3e ("i2c: Add drivers for the AMD PCIe MP2 I2C controller")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
drivers/i2c/busses/i2c-amd-mp2-pci.c