summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTiezhu Yang <kernelpatch@126.com>2016-06-25 12:35:22 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2016-07-15 15:44:45 -0400
commitfcbefc3b2bfb4dd1a230b3082b68bc7cf7c081e7 (patch)
tree4ef708343915ce4d1d02ed1e448a8ee0da09c8b9 /drivers
parent3fb134cb4c170debf2b786d689fe263186feea4b (diff)
scsi: ufs: remove unnecessary goto label
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> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/ufs/ufshcd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 8e8989a1859b..f08d41a2d70b 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: