cxgb3/l2t: Fix undefined behaviour
The use of zero-sized array causes undefined behaviour when it is not the last member in a structure. As it happens to be in this case. Also, the current code makes use of a language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as this one is a flexible array member, introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last. Which is beneficial to cultivate a high-quality code. Fixes: e48f129c ("[SCSI] cxgb3i: convert cdev->l2opt to use rcu to prevent NULL dereference") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: David S. Miller <davem@davemloft.net>
parent
a2c7023f
-
mentioned in commit a1b9b65e
-
mentioned in commit cfb8d781
-
mentioned in commit 94bef5d5
-
mentioned in commit 3d87c75d
-
mentioned in commit 3dbae155
-
mentioned in commit 51022f87
-
mentioned in commit c6e2ac3b
-
mentioned in commit 842ae1f5
-
mentioned in commit a44ce513
-
mentioned in commit 6524d794
-
mentioned in commit fba4168e
-
mentioned in commit 7ff87182
Please register or sign in to comment