scsi: ufs: Fix potential memory leak
The function ufs_read_device_desc_data() allocates some memory
for use in reading the device descriptor, but it fails to free
the memory when done. Add kfree() to fix the potential memory leak.
In addition, this change replaces the kstrdup() with devm_kzalloc()
so that the allocated memory is freed when the driver is unloaded.
Change-Id: Ib5daa516fcd8e93a2f8cfbe7058c97b673d4f133
Signed-off-by:
Bao D. Nguyen <nguyenb@codeaurora.org>
Loading
Please register or sign in to comment