This is a note to let you know that I've just added the patch titled wilc1000: Fix memleak in wilc_sdio_probe to the 5.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: wilc1000-fix-memleak-in-wilc_sdio_probe.patch and it can be found in the queue-5.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 9c103fd75ff79748d5318d947e2e2d3bdc6f5005 Author: Dinghao Liu <dinghao.liu@xxxxxxxxxx> Date: Thu Aug 20 13:48:19 2020 +0800 wilc1000: Fix memleak in wilc_sdio_probe [ Upstream commit 8d95ab34b21ee0f870a9185b6457e8f6eb54914c ] When devm_clk_get() returns -EPROBE_DEFER, sdio_priv should be freed just like when wilc_cfg80211_init() fails. Fixes: 8692b047e86cf ("staging: wilc1000: look for rtc_clk clock") Signed-off-by: Dinghao Liu <dinghao.liu@xxxxxxxxxx> Acked-by: Ajay Singh <ajay.kathat@xxxxxxxxxxxxx> Signed-off-by: Kalle Valo <kvalo@xxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20200820054819.23365-1-dinghao.liu@xxxxxxxxxx Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/staging/wilc1000/sdio.c b/drivers/staging/wilc1000/sdio.c index 36eb589263bfd..b14e4ed6134fc 100644 --- a/drivers/staging/wilc1000/sdio.c +++ b/drivers/staging/wilc1000/sdio.c @@ -151,9 +151,10 @@ static int wilc_sdio_probe(struct sdio_func *func, wilc->dev = &func->dev; wilc->rtc_clk = devm_clk_get(&func->card->dev, "rtc"); - if (PTR_ERR_OR_ZERO(wilc->rtc_clk) == -EPROBE_DEFER) + if (PTR_ERR_OR_ZERO(wilc->rtc_clk) == -EPROBE_DEFER) { + kfree(sdio_priv); return -EPROBE_DEFER; - else if (!IS_ERR(wilc->rtc_clk)) + } else if (!IS_ERR(wilc->rtc_clk)) clk_prepare_enable(wilc->rtc_clk); dev_info(&func->dev, "Driver Initializing success\n");