Hi.

Running cppcheck on VirtualBox sources pointed me to what I think is a
bug on falcon_clear_interrupts() will get a null pointer dereference
is the PCI revision is not FALON_REV_B0.  I have attached a proposed
patch and also appended that patch inline for easier reading.

I am sorry that I have not even attempted to see if the patch compiles
because I don't think I have time to do a VirtualBox build until at
least the weekend.  As far as I know, I do not actually run code in
this file.  Also, I have not been involved in contributing to
VirtualBox development, so please excuse any violations of contributor
conventions and please feel free to let me know how I can do better
next time.

If this patch compiles and there are no complaints, I request that you
merge this patch or another fix for this issue more to your liking.  I
hereby grant the permissions of the "MIT license" for any copyright
interest I may have in this patch.  Please let me know if you need me
to make any other statement so that you can merge this patch.

Adam Richter


Index: src/VBox/Devices/PC/ipxe/src/drivers/net/etherfabric.c
===================================================================
--- src/VBox/Devices/PC/ipxe/src/drivers/net/etherfabric.c      (revision 78203)
+++ src/VBox/Devices/PC/ipxe/src/drivers/net/etherfabric.c      (working copy)
@@ -3798,7 +3798,8 @@
        }
        else {
                /* write to the INT_ACK register */
-               falcon_writel ( efab, 0, FCN_INT_ACK_KER_REG_A1 );
+               static const efab_dword_t zero;
+               falcon_writel ( efab, &zero, FCN_INT_ACK_KER_REG_A1 );
                mb();
                falcon_readl ( efab, &reg,
                               WORK_AROUND_BROKEN_PCI_READS_REG_KER_A1 );
Index: src/VBox/Devices/PC/ipxe/src/drivers/net/etherfabric.c
===================================================================
--- src/VBox/Devices/PC/ipxe/src/drivers/net/etherfabric.c	(revision 78203)
+++ src/VBox/Devices/PC/ipxe/src/drivers/net/etherfabric.c	(working copy)
@@ -3798,7 +3798,8 @@
 	}
 	else {
 		/* write to the INT_ACK register */
-		falcon_writel ( efab, 0, FCN_INT_ACK_KER_REG_A1 );
+		static const efab_dword_t zero;
+		falcon_writel ( efab, &zero, FCN_INT_ACK_KER_REG_A1 );
 		mb();
 		falcon_readl ( efab, &reg,
 			       WORK_AROUND_BROKEN_PCI_READS_REG_KER_A1 );
_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev

Reply via email to