* [PATCH] scsi: ufs: remove unnecessary goto label
@ 2016-06-25 4:35 Tiezhu Yang
2016-07-15 19:45 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Tiezhu Yang @ 2016-06-25 4:35 UTC (permalink / raw)
To: martin.petersen, jejb, vinholikatti; +Cc: linux-scsi, linux-kernel
When buff_ascii kmalloc failed, there is no need to call kfree,
it should return -ENOMEM directly, this patch fixes it.
Signed-off-by: Tiezhu Yang <kernelpatch@126.com>
---
drivers/scsi/ufs/ufshcd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 8e8989a..f08d41a 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -2137,7 +2137,7 @@ int ufshcd_read_string_desc(struct ufs_hba *hba, int desc_index, u8 *buf,
buff_ascii = kmalloc(ascii_len, GFP_KERNEL);
if (!buff_ascii) {
err = -ENOMEM;
- goto out_free_buff;
+ goto out;
}
/*
@@ -2156,7 +2156,6 @@ int ufshcd_read_string_desc(struct ufs_hba *hba, int desc_index, u8 *buf,
size - QUERY_DESC_HDR_SIZE);
memcpy(buf + QUERY_DESC_HDR_SIZE, buff_ascii, ascii_len);
buf[QUERY_DESC_LENGTH_OFFSET] = ascii_len + QUERY_DESC_HDR_SIZE;
-out_free_buff:
kfree(buff_ascii);
}
out:
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] scsi: ufs: remove unnecessary goto label
2016-06-25 4:35 [PATCH] scsi: ufs: remove unnecessary goto label Tiezhu Yang
@ 2016-07-15 19:45 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2016-07-15 19:45 UTC (permalink / raw)
To: Tiezhu Yang; +Cc: martin.petersen, jejb, vinholikatti, linux-scsi, linux-kernel
>>>>> "Tiezhu" == Tiezhu Yang <kernelpatch@126.com> writes:
Tiezhu> When buff_ascii kmalloc failed, there is no need to call kfree,
Tiezhu> it should return -ENOMEM directly, this patch fixes it.
Applied to 4.8/scsi-queue.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-15 19:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-25 4:35 [PATCH] scsi: ufs: remove unnecessary goto label Tiezhu Yang
2016-07-15 19:45 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).