In ufshcd_parse_clock_info(), temporary memory allocated by
devm_kzalloc() is released by kfree().  The devres mechanism cannot
track the release and it causes trouble when removing the driver.

Fix it by allocating it with plain kcalloc() instead of devm_kzalloc()
as the temporary memory is always freed in that function.

Signed-off-by: Akinobu Mita <m...@fixstars.com>
Cc: Vinayak Holikatti <vinholika...@gmail.com>
Cc: Dolev Raviv <dra...@codeaurora.org>
Cc: Subhash Jadavani <subha...@codeaurora.org>
Cc: Yaniv Gardi <yga...@codeaurora.org>
Cc: Sujit Reddy Thumma <sthu...@codeaurora.org>
Cc: Maya Erez <me...@codeaurora.org>
Cc: Sahitya Tummala <stumm...@codeaurora.org>
Cc: Christoph Hellwig <h...@lst.de>
Cc: "James E.J. Bottomley" <jbottom...@parallels.com>
Cc: linux-scsi@vger.kernel.org
---
 drivers/scsi/ufs/ufshcd-pltfrm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c
index 0c030ad..67b1f6c 100644
--- a/drivers/scsi/ufs/ufshcd-pltfrm.c
+++ b/drivers/scsi/ufs/ufshcd-pltfrm.c
@@ -99,8 +99,7 @@ static int ufshcd_parse_clock_info(struct ufs_hba *hba)
                goto out;
        }
 
-       clkfreq = devm_kzalloc(dev, sz * sizeof(*clkfreq),
-                       GFP_KERNEL);
+       clkfreq = kcalloc(sz, sizeof(*clkfreq), GFP_KERNEL);
        if (!clkfreq) {
                ret = -ENOMEM;
                goto out;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to