Skip to content
Commit a99a5476 authored by Xiongfeng Wang's avatar Xiongfeng Wang Committed by Greg Kroah-Hartman
Browse files

mmc: sdhci-pci: Fix possible memory leak caused by missing pci_dev_put()

commit 222cfa01 upstream.

pci_get_device() will increase the reference count for the returned
pci_dev. We need to use pci_dev_put() to decrease the reference count
before amd_probe() returns. There is no problem for the 'smbus_dev ==
NULL' branch because pci_dev_put() can also handle the NULL input
parameter case.

Fixes: 659c9bc1

 ("mmc: sdhci-pci: Build o2micro support in the same module")
Signed-off-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20221114083100.149200-1-wangxiongfeng2@huawei.com
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4a1b6f78
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment