From: "Peter Wang (王信友)" <peter.wang@mediatek.com>
To: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"jslebodn@redhat.com" <jslebodn@redhat.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"ahalaney@redhat.com" <ahalaney@redhat.com>,
"beanhuo@micron.com" <beanhuo@micron.com>,
"avri.altman@wdc.com" <avri.altman@wdc.com>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
"bvanassche@acm.org" <bvanassche@acm.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
"manivannan.sadhasivam@linaro.org"
<manivannan.sadhasivam@linaro.org>,
"James.Bottomley@HansenPartnership.com"
<James.Bottomley@HansenPartnership.com>
Subject: Re: [PATCH] scsi: ufs: core: Free memory allocated for model before reinit
Date: Fri, 14 Jun 2024 06:30:50 +0000 [thread overview]
Message-ID: <5c3acfacb567cb9871f7ad3721b50d0c4970b676.camel@mediatek.com> (raw)
In-Reply-To: <20240613200202.2524194-1-jslebodn@redhat.com>
On Thu, 2024-06-13 at 16:02 -0400, Joel Slebodnick wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> Under the conditions that a device is to be reinitialized within
> ufshcd_probe_hba, the device must first be fully reset.
>
> Resetting the device should include freeing U8 model (member of
> dev_info) but does not, and this causes a memory leak.
> ufs_put_device_desc is responsible for freeing model.
>
> unreferenced object 0xffff3f63008bee60 (size 32):
> comm "kworker/u33:1", pid 60, jiffies 4294892642
> hex dump (first 32 bytes):
> 54 48 47 4a 46 47 54 30 54 32 35 42 41 5a 5a 41 THGJFGT0T25BAZZA
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> backtrace (crc ed7ff1a9):
> [<ffffb86705f1243c>] kmemleak_alloc+0x34/0x40
> [<ffffb8670511cee4>] __kmalloc_noprof+0x1e4/0x2fc
> [<ffffb86705c247fc>] ufshcd_read_string_desc+0x94/0x190
> [<ffffb86705c26854>] ufshcd_device_init+0x480/0xdf8
> [<ffffb86705c27b68>] ufshcd_probe_hba+0x3c/0x404
> [<ffffb86705c29264>] ufshcd_async_scan+0x40/0x370
> [<ffffb86704f43e9c>] async_run_entry_fn+0x34/0xe0
> [<ffffb86704f34638>] process_one_work+0x154/0x298
> [<ffffb86704f34a74>] worker_thread+0x2f8/0x408
> [<ffffb86704f3cfa4>] kthread+0x114/0x118
> [<ffffb86704e955a0>] ret_from_fork+0x10/0x20
>
> Fixes: 96a7141da332 ("scsi: ufs: core: Add support for reinitializing
> the UFS device")
> Cc: <stable@vger.kernel.org>
>
> Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
> Reviewed-by: Bart Van Assche <bvanassche@acm.org>
> Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
>
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
next prev parent reply other threads:[~2024-06-14 6:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-13 18:27 Joel Slebodnick
2024-06-13 19:15 ` Bart Van Assche
2024-06-13 19:34 ` Andrew Halaney
2024-06-13 20:02 ` Joel Slebodnick
2024-06-14 6:27 ` Avri Altman
2024-06-14 6:30 ` Peter Wang (王信友) [this message]
2024-06-14 2:23 ` Martin K. Petersen
2024-06-14 8:28 ` Bean Huo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5c3acfacb567cb9871f7ad3721b50d0c4970b676.camel@mediatek.com \
--to=peter.wang@mediatek.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=ahalaney@redhat.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=jslebodn@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=martin.petersen@oracle.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®