]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
misc: rtsx: Fix memory leak in rtsx_pci_probe
authorKeita Suzuki <keitasuzuki.park@sslab.ics.keio.ac.jp>
Wed, 9 Sep 2020 07:18:51 +0000 (07:18 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Sep 2020 15:30:37 +0000 (17:30 +0200)
commitbc28369c6189009b66d9619dd9f09bd8c684bb98
tree98d4e657121565d045d17ca6629d8f66269d9665
parent7369fa47c442a6d4268989b64fbc28af48f9126e
misc: rtsx: Fix memory leak in rtsx_pci_probe

When mfd_add_devices() fail, pcr->slots should also be freed. However,
the current implementation does not free the member, leading to a memory
leak.

Fix this by adding a new goto label that frees pcr->slots.

Signed-off-by: Keita Suzuki <keitasuzuki.park@sslab.ics.keio.ac.jp>
Link: https://lore.kernel.org/r/20200909071853.4053-1-keitasuzuki.park@sslab.ics.keio.ac.jp
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/cardreader/rtsx_pcr.c