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 cfb8d781
-
mentioned in commit a1b9b65e
-
mentioned in commit 94bef5d5
-
mentioned in commit 3d87c75d
-
mentioned in commit 5c91aa1d
-
mentioned in commit fe946db6
-
mentioned in commit 06ccf63d
-
mentioned in commit 4ea19ecf
-
mentioned in commit 13402837
-
mentioned in commit 307ed94c
-
mentioned in commit 43951585
-
mentioned in commit a1c4b924
-
mentioned in commit 1223f3db
-
mentioned in commit 16c3380f
-
mentioned in commit d6cdad87
-
mentioned in commit 6e88abb8
-
mentioned in commit 8695e0b1
-
mentioned in commit ffbc9376
-
mentioned in commit 57e86fa1
-
mentioned in commit 0a368bf0
-
mentioned in commit 1fa0949b
-
mentioned in commit a2008395
-
mentioned in commit beb69f15
-
mentioned in commit 7856e9f1
-
mentioned in commit 1d9e13e8
-
mentioned in commit f36aaf8b
-
mentioned in commit 5299a11a
-
mentioned in commit 31232272
-
mentioned in commit e76018cb
-
mentioned in commit 0ead3364
-
mentioned in commit 5a58ec8c
-
mentioned in commit 859b4941