Skip to contentSkip to conversation

staging: android: ion: Initialize dma_address of new sg list

PATCH Superseded Liam Mark 4 participants 8 messages Feb 10, 2018 – Feb 16, 2018 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Liam Mark

author
#0 lore raw

PATCH 1/1 staging: android: ion: Initialize dma_address of new sg list

Fix the dup_sg_table function to initialize the dma_address of the new sg list entries instead of the source dma_address entries.

Fixes 17fd283f3870 ("staging: android: ion: Duplicate sg_table")
---
 drivers/staging/android/ion/ion.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/android/ion/ion.c +1 -1
index f480885e346b..3ace3a0d9210 100644
@@ -197,7 +197,7 @@ static struct sg_table *dup_sg_table(struct sg_table *table)
 	new_sg = new_table->sgl;
 	for_each_sg(table->sgl, sg, table->nents, i) {
 		memcpy(new_sg, sg, sizeof(*sg));
-		sg->dma_address = 0;
+		new_sg->dma_address = 0;
 		new_sg = sg_next(new_sg);
 	}
 
Signature · 9 lines
1.8.5.2


Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
#1 lore raw
Quoted 5 lines · Liam Mark

Fix the dup_sg_table function to initialize the dma_address of the new sg list entries instead of the source dma_address entries.

Fixes 17fd283f3870 ("staging: android: ion: Duplicate sg_table")

How did you find this bug? What are the user visible effects of this bug? I'm probably going to ask you to send a v2 patch with a new changelog depending on the answers to these questions.

regards,
dan carpenter

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

author
#2 lore raw
Quoted 10 lines · Dan Carpenter
Quoted 5 lines · Liam Mark

Fix the dup_sg_table function to initialize the dma_address of the new sg list entries instead of the source dma_address entries.

Fixes 17fd283f3870 ("staging: android: ion: Duplicate sg_table")

How did you find this bug? What are the user visible effects of this bug? I'm probably going to ask you to send a v2 patch with a new changelog depending on the answers to these questions.

I noticed the bug when reading through the code, I haven’t seen any visible effects of this bug.

Quoted 1 line

From looking at the code I don’t see any obvious ways that this bug would

introduce any issues with the current code base.

Liam

Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

#3 lore raw
Quoted 14 lines · Liam Mark
Quoted 10 lines · Dan Carpenter
Quoted 5 lines · Liam Mark

Fix the dup_sg_table function to initialize the dma_address of the new sg list entries instead of the source dma_address entries.

Fixes 17fd283f3870 ("staging: android: ion: Duplicate sg_table")

How did you find this bug? What are the user visible effects of this bug? I'm probably going to ask you to send a v2 patch with a new changelog depending on the answers to these questions.

Quoted 8 lines

I noticed the bug when reading through the code, I haven’t seen any visible effects of this bug.

From looking at the code I don’t see any obvious ways that this bug would
introduce any issues with the current code base.

Liam

Given the way we duplicate the sg_list this should be harmless but you are right it's cleaner if we initialize the new list. You can add my Ack when you update with a new change log clarifying this.

Thanks,
Laura
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

author
#4 lore raw
Quoted 25 lines · Laura Abbott
Quoted 10 lines · Liam Mark
Quoted 7 lines · Dan Carpenter
Quoted 5 lines · Liam Mark

Fix the dup_sg_table function to initialize the dma_address of the new sg list entries instead of the source dma_address entries.

Fixes 17fd283f3870 ("staging: android: ion: Duplicate sg_table")
Quoted 8 lines
Quoted 3 lines

How did you find this bug? What are the user visible effects of this bug? I'm probably going to ask you to send a v2 patch with a new changelog depending on the answers to these questions.

I noticed the bug when reading through the code, I haven?t seen any visible effects of this bug.

From looking at the code I don?t see any obvious ways that this bug

would

Quoted 4 lines

introduce any issues with the current code base.

Liam

Quoted 7 lines

Given the way we duplicate the sg_list this should be harmless but you are right it's cleaner if we initialize the new list. You can add my Ack when you update with a new change log clarifying this.

Thanks,
Laura

Will do.

Thanks,
Liam

Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

maintainer
#5 lore raw
In reply to Liam Mark
Quoted 4 lines · Liam Mark

Fix the dup_sg_table function to initialize the dma_address of the new sg list entries instead of the source dma_address entries.

Fixes 17fd283f3870 ("staging: android: ion: Duplicate sg_table")

So this should be sent to the stable trees as well, right?

Please add that when you resend...

thanks,

greg k-h
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

author
#6 lore raw
Quoted 9 lines · Greg KH
Quoted 4 lines · Liam Mark

Fix the dup_sg_table function to initialize the dma_address of the new sg list entries instead of the source dma_address entries.

Fixes 17fd283f3870 ("staging: android: ion: Duplicate sg_table")

So this should be sent to the stable trees as well, right?

Please add that when you resend...

My understanding was that I should only send this to the stable branch if it fixes a real bug.

Both myself and Laura can't see any actual problems that result from this issue, the change is more to help future proof the code.

My commit message wasn't clear about this and could have mislead people into thinking there was a bug.
I will update the commit message to make it clear that this issue doesn't currently result in any problem.

Do you still want me to send it to the stable trees?

Thanks,
Liam

Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

maintainer
#7 lore raw
Quoted 18 lines · Liam Mark
Quoted 9 lines · Greg KH
Quoted 4 lines · Liam Mark

Fix the dup_sg_table function to initialize the dma_address of the new sg list entries instead of the source dma_address entries.

Fixes 17fd283f3870 ("staging: android: ion: Duplicate sg_table")

So this should be sent to the stable trees as well, right?

Please add that when you resend...

My understanding was that I should only send this to the stable branch if it fixes a real bug.

Both myself and Laura can't see any actual problems that result from this issue, the change is more to help future proof the code.

Quoted 6 lines

My commit message wasn't clear about this and could have mislead people into thinking there was a bug.
I will update the commit message to make it clear that this issue doesn't currently result in any problem.

Do you still want me to send it to the stable trees?

If it's not a bugfix, no need to. But please clean up your changelog text as it implies that it is a bugfix...

thanks,

greg k-h