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>
-
mentioned in commit 85f4c951
-
mentioned in commit 987f028b
-
mentioned in commit cfb8d781
-
mentioned in commit a1b9b65e
-
mentioned in commit 94bef5d5
-
mentioned in commit 3dbae155
-
mentioned in commit 3d87c75d
-
mentioned in commit e8dc73c9
-
mentioned in commit 2f920c0f
-
mentioned in commit 6960b033
-
mentioned in commit 2d4ccc2a
-
mentioned in commit 33ad1e5d
-
mentioned in commit b2e1cbfd
-
mentioned in commit 1a91a36a
-
mentioned in commit a44ce513
-
mentioned in commit 842ae1f5
-
mentioned in commit 51022f87
-
mentioned in commit 6524d794
-
mentioned in commit 7ff87182
-
mentioned in commit c6e2ac3b
-
mentioned in commit fba4168e
-
mentioned in commit 9106137c
-
mentioned in commit f682dc71
-
mentioned in commit 1e361632
-
mentioned in commit 0a368bf0
-
mentioned in commit 5a58ec8c
-
mentioned in commit f36aaf8b
-
mentioned in commit 8695e0b1
-
mentioned in commit d34fced4
-
mentioned in commit db78538c
-
mentioned in commit 8ac7571a
-
mentioned in commit c50c75e9
-
mentioned in commit 3381df09
-
mentioned in commit 57e86fa1
-
mentioned in commit f6e8c474
-
mentioned in commit ffbc9376
-
mentioned in commit 29637951
-
mentioned in commit 10cfde5d