]> git.itanic.dy.fi Git - linux-stable/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>
Thu, 29 Oct 2020 09:12:15 +0000 (10:12 +0100)
commitb2e203d14f9a1cb21d55ad17295395d1edba4d06
tree461411669f762ac416370d3075d5a518d80a30df
parent4e57482e8440fac7137832629109730ea4b267aa
misc: rtsx: Fix memory leak in rtsx_pci_probe

[ Upstream commit bc28369c6189009b66d9619dd9f09bd8c684bb98 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/misc/cardreader/rtsx_pcr.c