Re: [PATCH] SCSI: fix data corruption caused by ses v2

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: James Bottomley
Date: Friday, February 15, 2008 - 8:53 am

On Wed, 2008-02-13 at 16:25 -0800, Yinghai Lu wrote:

OK, I added this with a fixup to eliminate the spurious goto

Thanks,

James

---

diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c
index cbba012..a6d9669 100644
--- a/drivers/scsi/ses.c
+++ b/drivers/scsi/ses.c
@@ -561,16 +561,15 @@ static int ses_intf_add(struct class_device *cdev,
 			if (desc_ptr) {
 				if (desc_ptr >= buf + page7_len) {
 					desc_ptr = NULL;
-					goto noname;
+				} else {
+					len = (desc_ptr[2] << 8) + desc_ptr[3];
+					desc_ptr += 4;
+					/* Add trailing zero - pushes into
+					 * reserved space */
+					desc_ptr[len] = '\0';
+					name = desc_ptr;
 				}
-				len = (desc_ptr[2] << 8) + desc_ptr[3];
-				desc_ptr += 4;
-				/* Add trailing zero - pushes into
-				 * reserved space */
-				desc_ptr[len] = '\0';
-				name = desc_ptr;
 			}
-		noname:
 			if (type_ptr[0] == ENCLOSURE_COMPONENT_DEVICE ||
 			    type_ptr[0] == ENCLOSURE_COMPONENT_ARRAY_DEVICE) {
 


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] scsi: ses fix mem leaking when fail to add intf, James Bottomley, (Sun Feb 10, 9:28 pm)
[SCSI] ses: fix memory leaks, Yinghai Lu, (Mon Feb 11, 12:25 am)
Re: [SCSI] ses: fix memory leaks, James Bottomley, (Mon Feb 11, 9:23 am)
Re: [SCSI] ses: fix memory leaks, James Bottomley, (Mon Feb 11, 10:02 am)
Re: [SCSI] ses: fix memory leaks, Yinghai Lu, (Mon Feb 11, 1:25 pm)
[PATCH] SCSI: fix data corruption caused by ses, Yinghai Lu, (Wed Feb 13, 12:10 am)
Re: [PATCH] SCSI: fix data corruption caused by ses, James Bottomley, (Wed Feb 13, 4:25 pm)
Re: [PATCH] SCSI: fix data corruption caused by ses, Yinghai Lu, (Wed Feb 13, 5:07 pm)
[PATCH] SCSI: fix data corruption caused by ses v2, Yinghai Lu, (Wed Feb 13, 5:25 pm)
Re: [PATCH] SCSI: fix data corruption caused by ses v2, James Bottomley, (Fri Feb 15, 8:53 am)
Re: [PATCH] SCSI: fix data corruption caused by ses v2, Yinghai Lu, (Fri Feb 15, 11:44 am)