Skip to contentSkip to conversation

fnic: fixup patch to resolve stack frame issues

PATCH In review Lee Duncan 3 participants 4 messages Jan 27, 2021

Subsystems (3)
lore
Share & tools
lore

Lee Duncan

author
#0 lore raw

PATCH 1/1 fnic: fixup patch to resolve stack frame issues

From: Hannes Reinecke <[email protected]>

Commit 42ec15ceaea7 fixed a gcc issue with unused variables, but introduced errors since it allocated an array of two u64-s but then used more than that. Set the arrays to the proper size.

Fixes 42ec15ceaea74b5f7a621fc6686cbf69ca66c4cf
---
 drivers/scsi/fnic/vnic_dev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/fnic/vnic_dev.c +3 -3
index 5988c300cc82..d29999064b89 100644
@@ -697,7 +697,7 @@ int vnic_dev_hang_notify(struct vnic_dev *vdev)
 
 int vnic_dev_mac_addr(struct vnic_dev *vdev, u8 *mac_addr)
 {
-	u64 a[2] = {};
+	u64 a[ETH_ALEN] = {};
 	int wait = 1000;
 	int err, i;
 
@@ -734,7 +734,7 @@ void vnic_dev_packet_filter(struct vnic_dev *vdev, int directed, int multicast,
 
 void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
 {
-	u64 a[2] = {};
+	u64 a[ETH_ALEN] = {};
 	int wait = 1000;
 	int err;
 	int i;
@@ -749,7 +749,7 @@ void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
 
 void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)
 {
-	u64 a[2] = {};
+	u64 a[ETH_ALEN] = {};
 	int wait = 1000;
 	int err;
 	int i;
Signature · 1 line
2.26.2
#1 lore raw
Quoted 38 lines · Lee Duncan

From: Hannes Reinecke <[email protected]>

Commit 42ec15ceaea7 fixed a gcc issue with unused variables, but introduced errors since it allocated an array of two u64-s but then used more than that. Set the arrays to the proper size.

Fixes 42ec15ceaea74b5f7a621fc6686cbf69ca66c4cf
---
 drivers/scsi/fnic/vnic_dev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/fnic/vnic_dev.c +2 -2
index 5988c300cc82..d29999064b89 100644
@@ -697,7 +697,7 @@ int vnic_dev_hang_notify(struct vnic_dev *vdev)
 
 int vnic_dev_mac_addr(struct vnic_dev *vdev, u8 *mac_addr)
 {
-	u64 a[2] = {};
+	u64 a[ETH_ALEN] = {};
 	int wait = 1000;
 	int err, i;
 
@@ -734,7 +734,7 @@ void vnic_dev_packet_filter(struct vnic_dev *vdev, int directed, int multicast,
 
 void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
 {
-	u64 a[2] = {};
+	u64 a[ETH_ALEN] = {};
 	int wait = 1000;
 	int err;
 	int i;

drivers/scsi/fnic/vnic_dev.c void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr) · line 755

Quoted 8 lines
drivers/scsi/fnic/vnic_dev.c +1 -1
@@ -749,7 +749,7 @@ void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
 
 void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)
 {
-	u64 a[2] = {};
+	u64 a[ETH_ALEN] = {};
 	int wait = 1000;
 	int err;
 	int i;

This may not be correct. Please do not review this yet. I will re-submit once I clear up my confusion.

Signature · 1 line
Lee Duncan
maintainer
#2 lore raw
In reply to Lee Duncan
Quoted 7 lines · Lee Duncan

From: Hannes Reinecke <[email protected]>

Commit 42ec15ceaea7 fixed a gcc issue with unused variables, but introduced errors since it allocated an array of two u64-s but then used more than that. Set the arrays to the proper size.

Fixes 42ec15ceaea74b5f7a621fc6686cbf69ca66c4cf

Please use the documented way to show sha1 commit ids to make it easier to understand:

42ec15ceaea7 ("scsi: fnic: fix invalid stack access")

thanks,

greg k-h

#3 lore raw
Quoted 9 lines · Greg KH
Quoted 7 lines · Lee Duncan

From: Hannes Reinecke <[email protected]>

Commit 42ec15ceaea7 fixed a gcc issue with unused variables, but introduced errors since it allocated an array of two u64-s but then used more than that. Set the arrays to the proper size.

Fixes 42ec15ceaea74b5f7a621fc6686cbf69ca66c4cf
Quoted 9 lines

Please use the documented way to show sha1 commit ids to make it easier to understand:

42ec15ceaea7 ("scsi: fnic: fix invalid stack access")

thanks,

greg k-h

I will Greg. Thank you.

Please delete this patch, though. It is not correct.

My apologies for the churn.

Signature · 1 line
Lee Duncan