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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 May 2020 06:16:36 +0000 (08:16 +0200)
commit9ca7a43110c62c716af2a2f45d149dba4327f9d7
tree8ce920ef6c5456bf01eebf1ca895c85a5a79315a
parentba8e4b6658bc89ad189f11d13466e9b8292adb36
i2c: amd-mp2-pci: Fix Oops in amd_mp2_pci_init() error handling

commit ac2b0813fceaf7cb3d8d46c7b33c90bae9fa49db upstream.

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: 529766e0a011 ("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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/busses/i2c-amd-mp2-pci.c